6 DTDDIR=../../Open-ILS/web/opac/locale
7 CHROME_PROPSDIR=../../Open-ILS/xul/staff_client/chrome/locale
8 SERVER_PROPSDIR=../../Open-ILS/xul/staff_client/server/locale
9 DOJO_LOCALE := $(shell echo ${LOCALE} | tr '[:upper:]-' '[:lower:]/')
10 DOJO_CON_SRC=../../Open-ILS/web/js/dojo/openils/conify/nls
11 DOJO_OPAC_SRC=../../Open-ILS/web/js/dojo/openils/opac/nls
12 DOJO_RPT_SRC=../../Open-ILS/web/js/dojo/openils/reports/nls
13 FMIDLSRC=../../Open-ILS/examples/fm_IDL.xml
16 FMIDLENTITY=fm_IDL.dtd
18 EVTSRC=../../Open-ILS/src/extras/ils_events.xml
19 EVTOUT=ils_events.xml.pot
20 EVTPO=ils_events.xml.po
22 REPORTDIR=../../Open-ILS/web/reports/
23 SQLSRCDIR=../../Open-ILS/src/sql/Pg/
24 SQLSRCFILE=950.data.seed-values.sql
27 SQLOUT=950.data.seed-values
28 PROGRESS=--progress none
30 # This Makefile can be used to generate and update PO files for Evergreen,
31 # as well as generate updated SQL, fieldmapper IDL, DTD and JavaScript
32 # property files from the PO.
36 # To create a new set of untranslated PO files for locale ll-LL:
37 # make LOCALE=ll-LL newpo
39 # To create a new set of POT files from the en-US source:
40 # make LOCALE=ll-LL newpot
42 # To update a set of translated PO files with new or changed en-US strings:
43 # make LOCALE=ll-LL updatepo
45 # To create a set of translated project files (DTDs, JavaScript message catalogs):
46 # make LOCALE=ll-LL project
48 # To install a set of translated project files:
49 # make LOCALE=ll-LL install
51 # Generate PO files from all POT files in POOUTDIR for locale LOCALE
53 @pot2po $(PROGRESS) -i $(POTSRC) -o $(POOUTDIR)/$(LOCALE)
54 @echo "Generated new PO files for locale $(LOCALE)"
56 # Generate a new set of POT files and entityized fieldmapper IDL
57 newpot: dtds2pot fmidl2pot fmidl2fmidlent ils2pot props2pot sql2pot dojo2pot
58 @echo "Generated new POT files"
60 # Generate DTD, JavaScript message catalogs, fieldmapper IDL,
61 # and SQL insert files from PO for locale LOCALE
62 project: po2dtds po2props po2sql fmidlpo2entity po2ils po2dojo
63 @echo "Generated project files for locale $(LOCALE)"
65 # Update PO files with new and changed strings from POT files
67 pot2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(POTSRC) -t $(POOUTDIR)/$(LOCALE) 2>&1
68 @echo "Updated PO files for locale $(LOCALE)"
70 # Update PO files with new and changed strings from POT files
72 @msgmerge -U $(POOUTDIR)/$(LOCALE)/opac.dtd.po $(POTSRC)/opac.dtd.pot 2>&1
73 @echo "Updated PO file opac.dtd.po for locale $(LOCALE)"
76 @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(DTDDIR)/en-US/ 2>&1
79 @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(CHROME_PROPSDIR)/en-US/ 2>&1
80 @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(SERVER_PROPSDIR)/en-US/ 2>&1
83 @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(DTDDIR)/en-US/ 2>&1
86 @scripts/dojo_resource.py --pot $(DOJO_CON_SRC)/conify.js --output $(POTSRC)/conify.js.pot
87 @scripts/dojo_resource.py --pot $(DOJO_OPAC_SRC)/opac.js --output $(POTSRC)/opac.js.pot
88 @scripts/dojo_resource.py --pot $(DOJO_RPT_SRC)/reports.js --output $(POTSRC)/reports.js.pot
91 @scripts/dojo_resource.py --create $(POINDIR)/$(LOCALE)/conify.js.po --output $(PROJECT)/$(LOCALE)/conify.js
92 @scripts/dojo_resource.py --create $(POINDIR)/$(LOCALE)/opac.js.po --output $(PROJECT)/$(LOCALE)/opac.js
93 @scripts/dojo_resource.py --create $(POINDIR)/$(LOCALE)/reports.js.po --output $(PROJECT)/$(LOCALE)/reports.js
96 @scripts/ils_events.py --pot $(EVTSRC) --output $(POTSRC)/$(EVTOUT)
99 @scripts/ils_events.py --create $(POINDIR)/$(LOCALE)/$(EVTPO) --locale $(LOCALE) --output $(PROJECT)/$(LOCALE)/$(EVTXML)
102 @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(CHROME_PROPSDIR)/en-US/ 2>&1
103 @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(SERVER_PROPSDIR)/en-US/ 2>&1
106 @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(DTDDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
109 @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(CHROME_PROPSDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
110 @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(SERVER_PROPSDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
113 @scripts/db-seed-i18n.py --pot $(SQLSRCDIR)/$(SQLSRCFILE) --output $(POTSRC)/$(SQLPOT)
114 # @msghack --empty -o $(POTSRC)/$(SQLPOT) $(POTSRC)/$(SQLPOT)
117 scripts/db-seed-i18n.py --sql $(POINDIR)/$(LOCALE)/$(SQLPO) --locale $(LOCALE) --output $(PROJECT)/$(LOCALE)/$(SQLOUT).sql
119 # Generate a fieldmapper IDL file that uses entities instead of hard-coded strings
121 @scripts/fieldmapper.py --convert $(FMIDLSRC) --output $(POOUTDIR)/$(FMIDLENT)
123 # Generate a POT file for translating the entity values
125 @scripts/fieldmapper.py --pot $(FMIDLSRC) --output $(POTSRC)/$(FMIDLOUT)
127 # Generate a set of entity declarations from a PO file
129 @scripts/fieldmapper.py --entity $(POINDIR)/$(LOCALE)/$(FMIDLPO) --output $(PROJECT)/$(LOCALE)/$(FMIDLENTITY)
131 # Generate en-US DTD from a POT file; required if any other locale is installed
133 mkdir -p $(PROJECT)/en-US
134 @scripts/fieldmapper.py --entity $(POINDIR)/en-US/$(FMIDLOUT) --output $(PROJECT)/en-US/$(FMIDLENTITY)
135 cp $(PROJECT)/en-US/$(FMIDLENTITY) $(DTDDIR)/en-US/
137 # Install updated project files to their corresponding location in the source tree
138 install: updatepo project fmidl2fmidlent fmidlpo2entity-en
139 mkdir -p $(CHROME_PROPSDIR)/$(LOCALE)
140 cp $(PROJECT)/$(LOCALE)/auth.properties $(CHROME_PROPSDIR)/$(LOCALE)/.
141 cp $(PROJECT)/$(LOCALE)/offline.properties $(CHROME_PROPSDIR)/$(LOCALE)/.
142 mkdir -p $(SERVER_PROPSDIR)/$(LOCALE)
143 cp $(PROJECT)/$(LOCALE)/admin.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
144 cp $(PROJECT)/$(LOCALE)/cat.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
145 cp $(PROJECT)/$(LOCALE)/circ.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
146 cp $(PROJECT)/$(LOCALE)/common.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
147 cp $(PROJECT)/$(LOCALE)/multiclass_search_help.html $(SERVER_PROPSDIR)/$(LOCALE)/.
148 cp $(PROJECT)/$(LOCALE)/patron.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
149 mkdir -p $(DTDDIR)/$(LOCALE)
150 cp $(PROJECT)/$(LOCALE)/conify.dtd $(DTDDIR)/$(LOCALE)/
151 cp $(PROJECT)/$(LOCALE)/lang.dtd $(CHROME_PROPSDIR)/$(LOCALE)/
152 cp $(PROJECT)/$(LOCALE)/lang.dtd $(DTDDIR)/$(LOCALE)/
153 cp $(PROJECT)/$(LOCALE)/opac.dtd $(DTDDIR)/$(LOCALE)/
154 cp $(PROJECT)/$(LOCALE)/reports.dtd $(DTDDIR)/$(LOCALE)/
155 cp $(PROJECT)/$(LOCALE)/vandelay.dtd $(DTDDIR)/$(LOCALE)/
156 cp $(PROJECT)/$(LOCALE)/$(FMIDLENTITY) $(DTDDIR)/$(LOCALE)/
157 @scripts/merge_ils_events.py --master $(EVTSRC) --localization $(PROJECT)/$(LOCALE)/$(EVTXML) --output $(EVTSRC)
158 cp $(PROJECT)/$(LOCALE)/$(SQLOUT).sql $(SQLSRCDIR)/$(SQLOUT)-$(LOCALE).sql
159 cp $(POOUTDIR)/$(FMIDLENT) $(REPORTDIR)/$(FMIDLENT)
160 mkdir -p $(DOJO_CON_SRC)/$(DOJO_LOCALE)
161 cp $(PROJECT)/$(LOCALE)/conify.js $(DOJO_CON_SRC)/$(DOJO_LOCALE)/conify.js
162 mkdir -p $(DOJO_OPAC_SRC)/$(DOJO_LOCALE)
163 cp $(PROJECT)/$(LOCALE)/opac.js $(DOJO_OPAC_SRC)/$(DOJO_LOCALE)/opac.js
164 mkdir -p $(DOJO_RPT_SRC)/$(DOJO_LOCALE)
165 cp $(PROJECT)/$(LOCALE)/reports.js $(DOJO_RPT_SRC)/$(DOJO_LOCALE)/reports.js