]> git.evergreen-ils.org Git - working/Evergreen.git/blob - build/i18n/Makefile
Translation updates - newpot
[working/Evergreen.git] / build / i18n / Makefile
1 PO=po
2 PROJECT=locale
3 LOCALE=fr-CA
4 STARTDIR=$(shell pwd)
5 POTLIST=$(shell ls -d po/*)
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 TT2_DATA_DIR=../../Open-ILS/src/data/locale
10 DOJO_LOCALE := $(shell echo ${LOCALE} | tr '[:upper:]' '[:lower:]')
11 DOJO_ACQ_SRC=../../Open-ILS/web/js/dojo/openils/acq/nls
12 DOJO_ACTOR_SRC=../../Open-ILS/web/js/dojo/openils/actor/nls
13 DOJO_AUTHORITY_SRC=../../Open-ILS/web/js/dojo/openils/authority/nls
14 DOJO_BOOKING_SRC=../../Open-ILS/web/js/dojo/openils/booking/nls
15 DOJO_CIRC_SRC=../../Open-ILS/web/js/dojo/openils/circ/nls
16 DOJO_CON_SRC=../../Open-ILS/web/js/dojo/openils/conify/nls
17 DOJO_OPAC_SRC=../../Open-ILS/web/js/dojo/openils/opac/nls
18 DOJO_RPT_SRC=../../Open-ILS/web/js/dojo/openils/reports/nls
19 DOJO_SERIAL_SRC=../../Open-ILS/web/js/dojo/openils/serial/nls
20 DOJO_URLVERIFY_SRC=../../Open-ILS/web/js/dojo/openils/URLVerify/nls
21 DOJO_USER_SRC=../../Open-ILS/web/js/dojo/openils/User/nls
22 DOJO_VANDELAY_SRC=../../Open-ILS/web/js/dojo/openils/vandelay/nls
23 DOJO_WIDGET_SRC=../../Open-ILS/web/js/dojo/openils/widget/nls
24 FMIDLSRC=../../Open-ILS/examples/fm_IDL.xml
25 FMIDLOUT=fm_IDL.dtd.pot
26 FMIDLENT=fm_IDL.xml
27 FMIDLENTITY=fm_IDL.dtd
28 EVTSRC=../../Open-ILS/src/extras/ils_events.xml
29 EVTOUT=ils_events.xml.pot
30 EVTPO=ils_events.xml.po
31 EVTXML=ils_events.xml
32 REPORTDIR=../../Open-ILS/web/reports/
33 SQLSRCDIR=../../Open-ILS/src/sql/Pg/
34 SQLSRCFILE=950.data.seed-values.sql
35 SQLPOT=db.seed.pot
36 SQLPO=db.seed.po
37 SQLOUT=950.data.seed-values
38 TPAC_SRC=../../Open-ILS/src/templates/opac/
39 TT_LOCALE=../../Open-ILS/src/templates/locale/
40 PROGRESS=--progress none
41
42 # This Makefile can be used to generate and update PO files for Evergreen,
43 # as well as generate updated SQL, fieldmapper IDL, DTD and JavaScript
44 # property files from the PO.
45 #
46 # Usage:
47 #
48 # To create a new set of untranslated PO files for locale ll-LL:
49 #   make LOCALE=ll-LL newpo
50 #
51 # To create a new set of POT files from the en-US source:
52 #   make LOCALE=ll-LL newpot
53 #
54 # To update a set of translated PO files with new or changed en-US strings:
55 #   make LOCALE=ll-LL updatepo
56 #
57 # To create a set of translated project files (DTDs, JavaScript message catalogs):
58 #   make LOCALE=ll-LL project
59 #
60 # To install a set of translated project files:
61 #   make LOCALE=ll-LL install
62
63 # Generate PO files from all POT files in PO for locale LOCALE
64 #
65 # The template for the standard GNU gettext format is
66 # template1/template1.pot
67 # template1/ll-LL.po
68 # template2/template2.pot
69 # template2/ll-LL.po
70
71 # So, iterate over the list of POT directories and 
72 # generate / update the specified locale PO file
73 newpo: 
74         @pot2po $(PROGRESS) -i po/acq.js/acq.js.pot -o $(PO)/acq.js/$(LOCALE).po 
75         @pot2po $(PROGRESS) -i po/admin.properties/admin.properties.pot -o $(PO)/admin.properties/$(LOCALE).po 
76         @pot2po $(PROGRESS) -i po/auth.properties/auth.properties.pot -o $(PO)/auth.properties/$(LOCALE).po 
77         @pot2po $(PROGRESS) -i po/authority.js/authority.js.pot -o $(PO)/authority.js/$(LOCALE).po 
78         @pot2po $(PROGRESS) -i po/capture.js/capture.js.pot -o $(PO)/capture.js/$(LOCALE).po 
79         @pot2po $(PROGRESS) -i po/cat.properties/cat.properties.pot -o $(PO)/cat.properties/$(LOCALE).po 
80         @pot2po $(PROGRESS) -i po/circ.properties/circ.properties.pot -o $(PO)/circ.properties/$(LOCALE).po 
81         @pot2po $(PROGRESS) -i po/common.properties/common.properties.pot -o $(PO)/common.properties/$(LOCALE).po 
82         @pot2po $(PROGRESS) -i po/conify.dtd/conify.dtd.pot -o $(PO)/conify.dtd/$(LOCALE).po 
83         @pot2po $(PROGRESS) -i po/conify.js/conify.js.pot -o $(PO)/conify.js/$(LOCALE).po 
84         @pot2po $(PROGRESS) -i po/db.seed/db.seed.pot -o $(PO)/db.seed/$(LOCALE).po 
85         @pot2po $(PROGRESS) -i po/fm_IDL.dtd/fm_IDL.dtd.pot -o $(PO)/fm_IDL.dtd/$(LOCALE).po 
86         @pot2po $(PROGRESS) -i po/ils_events.xml/ils_events.xml.pot -o $(PO)/ils_events.xml/$(LOCALE).po 
87         @pot2po $(PROGRESS) -i po/lang.dtd/lang.dtd.pot -o $(PO)/lang.dtd/$(LOCALE).po 
88         @pot2po $(PROGRESS) -i po/multiclass_search_help.html/multiclass_search_help.html.pot -o $(PO)/multiclass_search_help.html/$(LOCALE).po 
89         @pot2po $(PROGRESS) -i po/offline.properties/offline.properties.pot -o $(PO)/offline.properties/$(LOCALE).po 
90         @pot2po $(PROGRESS) -i po/opac.dtd/opac.dtd.pot -o $(PO)/opac.dtd/$(LOCALE).po 
91         @pot2po $(PROGRESS) -i po/opac.js/opac.js.pot -o $(PO)/opac.js/$(LOCALE).po 
92         @pot2po $(PROGRESS) -i po/patron.properties/patron.properties.pot -o $(PO)/patron.properties/$(LOCALE).po 
93         @pot2po $(PROGRESS) -i po/pickup_and_return.js/pickup_and_return.js.pot -o $(PO)/pickup_and_return.js/$(LOCALE).po 
94         @pot2po $(PROGRESS) -i po/pull_list.js/pull_list.js.pot -o $(PO)/pull_list.js/$(LOCALE).po 
95         @pot2po $(PROGRESS) -i po/register.js/register.js.pot -o $(PO)/register.js/$(LOCALE).po 
96         @pot2po $(PROGRESS) -i po/reports.dtd/reports.dtd.pot -o $(PO)/reports.dtd/$(LOCALE).po 
97         @pot2po $(PROGRESS) -i po/reports.js/reports.js.pot -o $(PO)/reports.js/$(LOCALE).po 
98         @pot2po $(PROGRESS) -i po/reservation.js/reservation.js.pot -o $(PO)/reservation.js/$(LOCALE).po 
99         @pot2po $(PROGRESS) -i po/selfcheck.js/selfcheck.js.pot -o $(PO)/selfcheck.js/$(LOCALE).po 
100         @pot2po $(PROGRESS) -i po/serial.properties/serial.properties.pot -o $(PO)/serial.properties/$(LOCALE).po 
101         @pot2po $(PROGRESS) -i po/tpac/tpac.pot -o $(PO)/tpac/$(LOCALE).po 
102         @pot2po $(PROGRESS) -i po/AutoFieldWidget.js/AutoFieldWidget.js.pot -o $(PO)/AutoFieldWidget.js/$(LOCALE).po 
103         @pot2po $(PROGRESS) -i po/FlattenerGrid.js/FlattenerGrid.js.pot -o $(PO)/FlattenerGrid.js/$(LOCALE).po 
104         @pot2po $(PROGRESS) -i po/PCrudFilterPane.js/PCrudFilterPane.js.pot -o $(PO)/PCrudFilterPane.js/$(LOCALE).po 
105         @pot2po $(PROGRESS) -i po/Searcher.js/Searcher.js.pot -o $(PO)/Searcher.js/$(LOCALE).po 
106         @pot2po $(PROGRESS) -i po/TranslatorPopup.js/TranslatorPopup.js.pot -o $(PO)/TranslatorPopup.js/$(LOCALE).po 
107         @pot2po $(PROGRESS) -i po/XULTermLoader.js/XULTermLoader.js.pot -o $(PO)/XULTermLoader.js/$(LOCALE).po 
108         @pot2po $(PROGRESS) -i po/User.js/User.js.pot -o $(PO)/User.js/$(LOCALE).po 
109         @pot2po $(PROGRESS) -i po/serial.js/serial.js.pot -o $(PO)/serial.js/$(LOCALE).po 
110         @pot2po $(PROGRESS) -i po/URLVerify.js/URLVerify.js.pot -o $(PO)/URLVerify.js/$(LOCALE).po 
111         @pot2po $(PROGRESS) -i po/match_set.js/match_set.js.pot -o $(PO)/match_set.js/$(LOCALE).po 
112         @pot2po $(PROGRESS) -i po/vandelay.js/vandelay.js.pot -o $(PO)/vandelay.js/$(LOCALE).po 
113         @echo "Generated new PO files for locale $(LOCALE)"
114
115 # Generate a new set of POT files and entityized fieldmapper IDL
116 newpot: dtds2pot fmidl2pot fmidl2fmidlent ils2pot props2pot sql2pot dojo2pot tpac2pot
117         @echo "Generated new POT files"
118
119 # Generate DTD, JavaScript message catalogs, fieldmapper IDL,
120 # and SQL insert files from PO for locale LOCALE
121 project: prep_output po2dtds po2props po2sql fmidlpo2entity po2ils po2dojo
122         @echo "Generated project files for locale $(LOCALE)"
123
124 # Update PO files with new and changed strings from POT files
125 updatepo: prep_output  
126         @pot2po $(PROGRESS) -i po/acq.js/acq.js.pot -o $(PO)/acq.js/$(LOCALE).po  -t $(PO)/acq.js/$(LOCALE).po 
127         @pot2po $(PROGRESS) -i po/admin.properties/admin.properties.pot -o $(PO)/admin.properties/$(LOCALE).po  -t $(PO)/admin.properties/$(LOCALE).po 
128         @pot2po $(PROGRESS) -i po/auth.properties/auth.properties.pot -o $(PO)/auth.properties/$(LOCALE).po  -t $(PO)/auth.properties/$(LOCALE).po 
129         @pot2po $(PROGRESS) -i po/authority.js/authority.js.pot -o $(PO)/authority.js/$(LOCALE).po  -t $(PO)/authority.js/$(LOCALE).po 
130         @pot2po $(PROGRESS) -i po/capture.js/capture.js.pot -o $(PO)/capture.js/$(LOCALE).po  -t $(PO)/capture.js/$(LOCALE).po 
131         @pot2po $(PROGRESS) -i po/cat.properties/cat.properties.pot -o $(PO)/cat.properties/$(LOCALE).po  -t $(PO)/cat.properties/$(LOCALE).po 
132         @pot2po $(PROGRESS) -i po/circ.properties/circ.properties.pot -o $(PO)/circ.properties/$(LOCALE).po  -t $(PO)/circ.properties/$(LOCALE).po 
133         @pot2po $(PROGRESS) -i po/common.properties/common.properties.pot -o $(PO)/common.properties/$(LOCALE).po  -t $(PO)/common.properties/$(LOCALE).po 
134         @pot2po $(PROGRESS) -i po/conify.dtd/conify.dtd.pot -o $(PO)/conify.dtd/$(LOCALE).po  -t $(PO)/conify.dtd/$(LOCALE).po 
135         @pot2po $(PROGRESS) -i po/conify.js/conify.js.pot -o $(PO)/conify.js/$(LOCALE).po  -t $(PO)/conify.js/$(LOCALE).po 
136         @pot2po $(PROGRESS) -i po/db.seed/db.seed.pot -o $(PO)/db.seed/$(LOCALE).po  -t $(PO)/db.seed/$(LOCALE).po 
137         @pot2po $(PROGRESS) -i po/fm_IDL.dtd/fm_IDL.dtd.pot -o $(PO)/fm_IDL.dtd/$(LOCALE).po  -t $(PO)/fm_IDL.dtd/$(LOCALE).po 
138         @pot2po $(PROGRESS) -i po/ils_events.xml/ils_events.xml.pot -o $(PO)/ils_events.xml/$(LOCALE).po  -t $(PO)/ils_events.xml/$(LOCALE).po 
139         @pot2po $(PROGRESS) -i po/lang.dtd/lang.dtd.pot -o $(PO)/lang.dtd/$(LOCALE).po  -t $(PO)/lang.dtd/$(LOCALE).po 
140         @pot2po $(PROGRESS) -i po/multiclass_search_help.html/multiclass_search_help.html.pot -o $(PO)/multiclass_search_help.html/$(LOCALE).po  -t $(PO)/multiclass_search_help.html/$(LOCALE).po 
141         @pot2po $(PROGRESS) -i po/offline.properties/offline.properties.pot -o $(PO)/offline.properties/$(LOCALE).po  -t $(PO)/offline.properties/$(LOCALE).po 
142         @pot2po $(PROGRESS) -i po/opac.dtd/opac.dtd.pot -o $(PO)/opac.dtd/$(LOCALE).po  -t $(PO)/opac.dtd/$(LOCALE).po 
143         @pot2po $(PROGRESS) -i po/opac.js/opac.js.pot -o $(PO)/opac.js/$(LOCALE).po  -t $(PO)/opac.js/$(LOCALE).po 
144         @pot2po $(PROGRESS) -i po/patron.properties/patron.properties.pot -o $(PO)/patron.properties/$(LOCALE).po  -t $(PO)/patron.properties/$(LOCALE).po 
145         @pot2po $(PROGRESS) -i po/pickup_and_return.js/pickup_and_return.js.pot -o $(PO)/pickup_and_return.js/$(LOCALE).po  -t $(PO)/pickup_and_return.js/$(LOCALE).po 
146         @pot2po $(PROGRESS) -i po/pull_list.js/pull_list.js.pot -o $(PO)/pull_list.js/$(LOCALE).po  -t $(PO)/pull_list.js/$(LOCALE).po 
147         @pot2po $(PROGRESS) -i po/register.js/register.js.pot -o $(PO)/register.js/$(LOCALE).po  -t $(PO)/register.js/$(LOCALE).po 
148         @pot2po $(PROGRESS) -i po/reports.dtd/reports.dtd.pot -o $(PO)/reports.dtd/$(LOCALE).po  -t $(PO)/reports.dtd/$(LOCALE).po 
149         @pot2po $(PROGRESS) -i po/reports.js/reports.js.pot -o $(PO)/reports.js/$(LOCALE).po  -t $(PO)/reports.js/$(LOCALE).po 
150         @pot2po $(PROGRESS) -i po/reservation.js/reservation.js.pot -o $(PO)/reservation.js/$(LOCALE).po  -t $(PO)/reservation.js/$(LOCALE).po 
151         @pot2po $(PROGRESS) -i po/selfcheck.js/selfcheck.js.pot -o $(PO)/selfcheck.js/$(LOCALE).po  -t $(PO)/selfcheck.js/$(LOCALE).po 
152         @pot2po $(PROGRESS) -i po/serial.properties/serial.properties.pot -o $(PO)/serial.properties/$(LOCALE).po  -t $(PO)/serial.properties/$(LOCALE).po 
153         @pot2po $(PROGRESS) -i po/tpac/tpac.pot -o $(PO)/tpac/$(LOCALE).po -t $(PO)/tpac/$(LOCALE).po 
154         @pot2po $(PROGRESS) -i po/AutoFieldWidget.js/AutoFieldWidget.js.pot -o $(PO)/AutoFieldWidget.js/$(LOCALE).po  -t $(PO)/AutoFieldWidget.js/$(LOCALE).po 
155         @pot2po $(PROGRESS) -i po/FlattenerGrid.js/FlattenerGrid.js.pot -o $(PO)/FlattenerGrid.js/$(LOCALE).po  -t $(PO)/FlattenerGrid.js/$(LOCALE).po 
156         @pot2po $(PROGRESS) -i po/PCrudFilterPane.js/PCrudFilterPane.js.pot -o $(PO)/PCrudFilterPane.js/$(LOCALE).po  -t $(PO)/PCrudFilterPane.js/$(LOCALE).po 
157         @pot2po $(PROGRESS) -i po/Searcher.js/Searcher.js.pot -o $(PO)/Searcher.js/$(LOCALE).po  -t $(PO)/Searcher.js/$(LOCALE).po 
158         @pot2po $(PROGRESS) -i po/TranslatorPopup.js/TranslatorPopup.js.pot -o $(PO)/TranslatorPopup.js/$(LOCALE).po  -t $(PO)/TranslatorPopup.js/$(LOCALE).po 
159         @pot2po $(PROGRESS) -i po/User.js/User.js.pot -o $(PO)/User.js/$(LOCALE).po  -t $(PO)/User.js/$(LOCALE).po 
160         @pot2po $(PROGRESS) -i po/XULTermLoader.js/XULTermLoader.js.pot -o $(PO)/XULTermLoader.js/$(LOCALE).po  -t $(PO)/XULTermLoader.js/$(LOCALE).po 
161         @pot2po $(PROGRESS) -i po/serial.js/serial.js.pot -o $(PO)/serial.js/$(LOCALE).po  -t $(PO)/serial.js/$(LOCALE).po 
162         @pot2po $(PROGRESS) -i po/URLVerify.js/URLVerify.js.pot -o $(PO)/URLVerify.js/$(LOCALE).po  -t $(PO)/URLVerify.js/$(LOCALE).po 
163         @pot2po $(PROGRESS) -i po/match_set.js/match_set.js.pot -o $(PO)/match_set.js/$(LOCALE).po  -t $(PO)/match_set.js/$(LOCALE).po 
164         @pot2po $(PROGRESS) -i po/vandelay.js/vandelay.js.pot -o $(PO)/vandelay.js/$(LOCALE).po  -t $(PO)/vandelay.js/$(LOCALE).po 
165         @echo "Updated PO files for locale $(LOCALE)"
166
167 dtds2pot:
168         @moz2po -P $(PROGRESS) -o $(PO)/conify.dtd/conify.dtd.pot -i $(DTDDIR)/en-US/conify.dtd 2>&1
169         @moz2po -P $(PROGRESS) -o $(PO)/lang.dtd/lang.dtd.pot -i $(DTDDIR)/en-US/lang.dtd 2>&1
170         @moz2po -P $(PROGRESS) -o $(PO)/opac.dtd/opac.dtd.pot -i $(DTDDIR)/en-US/opac.dtd 2>&1
171         @moz2po -P $(PROGRESS) -o $(PO)/reports.dtd/reports.dtd.pot -i $(DTDDIR)/en-US/reports.dtd 2>&1
172
173 dojo2pot:
174         @scripts/dojo_resource.py --pot $(DOJO_ACQ_SRC)/acq.js --output $(PO)/acq.js/acq.js.pot
175         @scripts/dojo_resource.py --pot $(DOJO_ACTOR_SRC)/register.js --output $(PO)/register.js/register.js.pot
176         @scripts/dojo_resource.py --pot $(DOJO_AUTHORITY_SRC)/authority.js --output $(PO)/authority.js/authority.js.pot
177         @scripts/dojo_resource.py --pot $(DOJO_BOOKING_SRC)/capture.js --output $(PO)/capture.js/capture.js.pot
178         @scripts/dojo_resource.py --pot $(DOJO_BOOKING_SRC)/pickup_and_return.js --output $(PO)/pickup_and_return.js/pickup_and_return.js.pot
179         @scripts/dojo_resource.py --pot $(DOJO_BOOKING_SRC)/pull_list.js --output $(PO)/pull_list.js/pull_list.js.pot
180         @scripts/dojo_resource.py --pot $(DOJO_BOOKING_SRC)/reservation.js --output $(PO)/reservation.js/reservation.js.pot
181         @scripts/dojo_resource.py --pot $(DOJO_CIRC_SRC)/selfcheck.js --output $(PO)/selfcheck.js/selfcheck.js.pot
182         @scripts/dojo_resource.py --pot $(DOJO_CON_SRC)/conify.js --output $(PO)/conify.js/conify.js.pot
183         @scripts/dojo_resource.py --pot $(DOJO_OPAC_SRC)/opac.js --output $(PO)/opac.js/opac.js.pot
184         @scripts/dojo_resource.py --pot $(DOJO_RPT_SRC)/reports.js --output $(PO)/reports.js/reports.js.pot
185         @scripts/dojo_resource.py --pot $(DOJO_SERIAL_SRC)/serial.js --output $(PO)/serial.js/serial.js.pot
186         @scripts/dojo_resource.py --pot $(DOJO_URLVERIFY_SRC)/URLVerify.js --output $(PO)/URLVerify.js/URLVerify.js.pot
187         @scripts/dojo_resource.py --pot $(DOJO_USER_SRC)/User.js --output $(PO)/User.js/User.js.pot
188         @scripts/dojo_resource.py --pot $(DOJO_VANDELAY_SRC)/match_set.js --output $(PO)/match_set.js/match_set.js.pot
189         @scripts/dojo_resource.py --pot $(DOJO_VANDELAY_SRC)/vandelay.js --output $(PO)/vandelay.js/vandelay.js.pot
190         @scripts/dojo_resource.py --pot $(DOJO_WIDGET_SRC)/AutoFieldWidget.js --output $(PO)/AutoFieldWidget.js/AutoFieldWidget.js.pot
191         @scripts/dojo_resource.py --pot $(DOJO_WIDGET_SRC)/FlattenerGrid.js --output $(PO)/FlattenerGrid.js/FlattenerGrid.js.pot
192         @scripts/dojo_resource.py --pot $(DOJO_WIDGET_SRC)/PCrudFilterPane.js --output $(PO)/PCrudFilterPane.js/PCrudFilterPane.js.pot
193         @scripts/dojo_resource.py --pot $(DOJO_WIDGET_SRC)/Searcher.js --output $(PO)/Searcher.js/Searcher.js.pot
194         @scripts/dojo_resource.py --pot $(DOJO_WIDGET_SRC)/TranslatorPopup.js --output $(PO)/TranslatorPopup.js/TranslatorPopup.js.pot
195         @scripts/dojo_resource.py --pot $(DOJO_WIDGET_SRC)/XULTermLoader.js --output $(PO)/XULTermLoader.js/XULTermLoader.js.pot
196
197 po2dojo: mklocale
198         @scripts/dojo_resource.py --create $(PO)/acq.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/acq.js
199         @scripts/dojo_resource.py --create $(PO)/authority.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/authority.js
200         @scripts/dojo_resource.py --create $(PO)/capture.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/capture.js
201         @scripts/dojo_resource.py --create $(PO)/conify.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/conify.js
202         @scripts/dojo_resource.py --create $(PO)/opac.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/opac.js
203         @scripts/dojo_resource.py --create $(PO)/pickup_and_return.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/pickup_and_return.js
204         @scripts/dojo_resource.py --create $(PO)/pull_list.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/pull_list.js
205         @scripts/dojo_resource.py --create $(PO)/register.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/register.js
206         @scripts/dojo_resource.py --create $(PO)/reservation.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/reservation.js
207         @scripts/dojo_resource.py --create $(PO)/reports.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/reports.js
208         @scripts/dojo_resource.py --create $(PO)/selfcheck.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/selfcheck.js
209         @scripts/dojo_resource.py --create $(PO)/AutoFieldWidget.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/AutoFieldWidget.js
210         @scripts/dojo_resource.py --create $(PO)/FlattenerGrid.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/FlattenerGrid.js
211         @scripts/dojo_resource.py --create $(PO)/PCrudFilterPane.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/PCrudFilterPane.js
212         @scripts/dojo_resource.py --create $(PO)/Searcher.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/Searcher.js
213         @scripts/dojo_resource.py --create $(PO)/TranslatorPopup.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/TranslatorPopup.js
214         @scripts/dojo_resource.py --create $(PO)/User.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/User.js
215         @scripts/dojo_resource.py --create $(PO)/XULTermLoader.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/XULTermLoader.js
216         @scripts/dojo_resource.py --create $(PO)/serial.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/serial.js
217         @scripts/dojo_resource.py --create $(PO)/URLVerify.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/URLVerify.js
218         @scripts/dojo_resource.py --create $(PO)/match_set.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/match_set.js
219         @scripts/dojo_resource.py --create $(PO)/vandelay.js/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/vandelay.js
220
221 ils2pot:
222         @scripts/ils_events.py --pot $(EVTSRC) --output $(PO)/ils_events.xml/$(EVTOUT)
223
224 po2ils: mklocale
225         @scripts/ils_events.py --create $(PO)/ils_events.xml/$(LOCALE).po --locale $(LOCALE) --output $(PROJECT)/$(LOCALE)/$(EVTXML) 
226
227 props2pot: mklocale
228         @moz2po -P $(PROGRESS) -o $(PO)/auth.properties/auth.properties.pot -i $(CHROME_PROPSDIR)/en-US/auth.properties 2>&1
229         @moz2po -P $(PROGRESS) -o $(PO)/offline.properties/offline.properties.pot -i $(CHROME_PROPSDIR)/en-US/offline.properties 2>&1
230         @moz2po -P $(PROGRESS) -o $(PO)/admin.properties/admin.properties.pot -i $(SERVER_PROPSDIR)/en-US/admin.properties 2>&1
231         @moz2po -P $(PROGRESS) -o $(PO)/cat.properties/cat.properties.pot -i $(SERVER_PROPSDIR)/en-US/cat.properties 2>&1
232         @moz2po -P $(PROGRESS) -o $(PO)/circ.properties/circ.properties.pot -i $(SERVER_PROPSDIR)/en-US/circ.properties 2>&1
233         @moz2po -P $(PROGRESS) -o $(PO)/common.properties/common.properties.pot -i $(SERVER_PROPSDIR)/en-US/common.properties 2>&1
234         @moz2po -P $(PROGRESS) -o $(PO)/multiclass_search_help.html/multiclass_search_help.html.pot -i $(SERVER_PROPSDIR)/en-US/multiclass_search_help.html 2>&1
235         @moz2po -P $(PROGRESS) -o $(PO)/patron.properties/patron.properties.pot -i $(SERVER_PROPSDIR)/en-US/patron.properties 2>&1
236         @moz2po -P $(PROGRESS) -o $(PO)/serial.properties/serial.properties.pot -i $(SERVER_PROPSDIR)/en-US/serial.properties 2>&1
237
238 tpac2pot: mklocale
239         @mkdir -p po/tpac
240         @xgettext.pl --plugin=tt2 --directory=$(TPAC_SRC) --output-dir=po/tpac/ --output=tpac.pot
241
242 mklocale:
243         @mkdir -p locale/$(LOCALE)
244
245 # There are some hacky things we need to do to make po2moz happy,
246 # like ensure that the .po file has either ".dtd" or ".properties" in
247 # the name to generate the appropriate output, even though that breaks
248 # GNU gettext recommended layout of foo.dtd/ll-LL.po
249 prep_output: mklocale
250         @for i in `ls -d $(PO)/*.dtd`; do cd $(STARTDIR)/$$i && ln -sf $(LOCALE).po $(LOCALE).dtd.po; done
251         @for i in `ls -d $(PO)/*.properties`; do cd $(STARTDIR)/$$i && ln -sf $(LOCALE).po $(LOCALE).properties.po; done
252         @for i in `ls -d $(PO)/*.html`; do cd $(STARTDIR)/$$i && ln -sf $(LOCALE).po $(LOCALE).html.po; done
253         @cd $(STARTDIR)
254
255 po2dtds: mklocale
256         @po2moz $(PROGRESS) -i $(PO)/conify.dtd/$(LOCALE).dtd.po -o $(PROJECT)/$(LOCALE)/conify.dtd -t $(DTDDIR)/en-US/conify.dtd 2>&1
257         @po2moz $(PROGRESS) -i $(PO)/lang.dtd/$(LOCALE).dtd.po -o $(PROJECT)/$(LOCALE)/lang.dtd -t $(DTDDIR)/en-US/lang.dtd 2>&1
258         @po2moz $(PROGRESS) -i $(PO)/opac.dtd/$(LOCALE).dtd.po -o $(PROJECT)/$(LOCALE)/opac.dtd -t $(DTDDIR)/en-US/opac.dtd 2>&1
259         @po2moz $(PROGRESS) -i $(PO)/reports.dtd/$(LOCALE).dtd.po -o $(PROJECT)/$(LOCALE)/reports.dtd -t $(DTDDIR)/en-US/reports.dtd 2>&1
260
261 po2props:
262         @po2moz $(PROGRESS) -i $(PO)/auth.properties/$(LOCALE).properties.po -o $(PROJECT)/$(LOCALE)/auth.properties -t $(CHROME_PROPSDIR)/en-US/auth.properties 2>&1
263         @po2moz $(PROGRESS) -i $(PO)/offline.properties/$(LOCALE).properties.po -o $(PROJECT)/$(LOCALE)/offline.properties -t $(CHROME_PROPSDIR)/en-US/offline.properties 2>&1
264         @po2moz $(PROGRESS) -i $(PO)/admin.properties/$(LOCALE).properties.po -o $(PROJECT)/$(LOCALE)/admin.properties -t $(SERVER_PROPSDIR)/en-US/admin.properties 2>&1
265         @po2moz $(PROGRESS) -i $(PO)/cat.properties/$(LOCALE).properties.po -o $(PROJECT)/$(LOCALE)/cat.properties -t $(SERVER_PROPSDIR)/en-US/cat.properties 2>&1
266         @po2moz $(PROGRESS) -i $(PO)/circ.properties/$(LOCALE).properties.po -o $(PROJECT)/$(LOCALE)/circ.properties -t $(SERVER_PROPSDIR)/en-US/circ.properties 2>&1
267         @po2moz $(PROGRESS) -i $(PO)/common.properties/$(LOCALE).properties.po -o $(PROJECT)/$(LOCALE)/common.properties -t $(SERVER_PROPSDIR)/en-US/common.properties 2>&1
268         @po2moz $(PROGRESS) -i $(PO)/multiclass_search_help.html/$(LOCALE).html.po -o $(PROJECT)/$(LOCALE)/multiclass_search_help.html -t $(SERVER_PROPSDIR)/en-US/multiclass_search_help.html 2>&1
269         @po2moz $(PROGRESS) -i $(PO)/patron.properties/$(LOCALE).properties.po -o $(PROJECT)/$(LOCALE)/patron.properties -t $(SERVER_PROPSDIR)/en-US/patron.properties 2>&1
270         @po2moz $(PROGRESS) -i $(PO)/serial.properties/$(LOCALE).properties.po -o $(PROJECT)/$(LOCALE)/serial.properties -t $(SERVER_PROPSDIR)/en-US/serial.properties 2>&1
271
272 sql2pot:
273         @scripts/db-seed-i18n.py --pot $(SQLSRCDIR)/$(SQLSRCFILE) --output $(PO)/db.seed/$(SQLPOT)
274 #       @msghack --empty -o $(PO)/$(SQLPOT) $(PO)/$(SQLPOT)
275
276 po2sql: mklocale
277         @scripts/db-seed-i18n.py --sql $(PO)/db.seed/$(LOCALE).po --locale $(LOCALE) --output $(PROJECT)/$(LOCALE)/$(SQLOUT).sql
278
279 # Generate a fieldmapper IDL file that uses entities instead of hard-coded strings
280 fmidl2fmidlent:
281         @scripts/fieldmapper.py --convert $(FMIDLSRC) --output $(PO)/$(FMIDLENT)
282
283 # Generate a POT file for translating the entity values
284 fmidl2pot:
285         @scripts/fieldmapper.py --pot $(FMIDLSRC) --output $(PO)/fm_IDL.dtd/$(FMIDLOUT)
286
287 # Generate a set of entity declarations from a PO file
288 fmidlpo2entity: mklocale
289         @scripts/fieldmapper.py --entity $(PO)/fm_IDL.dtd/$(LOCALE).po --output $(PROJECT)/$(LOCALE)/$(FMIDLENTITY)
290
291 # Generate en-US DTD from a POT file; required if any other locale is installed
292 fmidlpo2entity-en:
293         mkdir -p $(PROJECT)/en-US
294         @scripts/fieldmapper.py --entity $(PO)/fm_IDL.dtd/$(FMIDLOUT) --output $(PROJECT)/en-US/$(FMIDLENTITY)
295         cp $(PROJECT)/en-US/$(FMIDLENTITY) $(DTDDIR)/en-US/
296
297 # Install updated project files to their corresponding location in the source tree
298 install: updatepo project fmidl2fmidlent fmidlpo2entity-en
299         mkdir -p $(CHROME_PROPSDIR)/$(LOCALE)
300         cp $(PROJECT)/$(LOCALE)/auth.properties $(CHROME_PROPSDIR)/$(LOCALE)/.
301         cp $(PROJECT)/$(LOCALE)/offline.properties $(CHROME_PROPSDIR)/$(LOCALE)/.
302         mkdir -p $(SERVER_PROPSDIR)/$(LOCALE)
303         cp $(PROJECT)/$(LOCALE)/admin.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
304         cp $(PROJECT)/$(LOCALE)/cat.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
305         cp $(PROJECT)/$(LOCALE)/circ.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
306         cp $(PROJECT)/$(LOCALE)/common.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
307         cp $(PROJECT)/$(LOCALE)/multiclass_search_help.html $(SERVER_PROPSDIR)/$(LOCALE)/.
308         cp $(PROJECT)/$(LOCALE)/patron.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
309         mkdir -p $(DTDDIR)/$(LOCALE)
310         cp $(PROJECT)/$(LOCALE)/conify.dtd $(DTDDIR)/$(LOCALE)/
311         cp $(PROJECT)/$(LOCALE)/lang.dtd $(CHROME_PROPSDIR)/$(LOCALE)/
312         cp $(PROJECT)/$(LOCALE)/lang.dtd $(DTDDIR)/$(LOCALE)/
313         cp $(PROJECT)/$(LOCALE)/opac.dtd $(DTDDIR)/$(LOCALE)/
314         cp $(PROJECT)/$(LOCALE)/reports.dtd $(DTDDIR)/$(LOCALE)/
315         cp $(PROJECT)/$(LOCALE)/serial.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
316         mkdir -p $(TT_LOCALE)
317         cp po/tpac/$(LOCALE).po $(TT_LOCALE)/tpac.$(LOCALE).po
318         cp $(PROJECT)/$(LOCALE)/$(FMIDLENTITY) $(DTDDIR)/$(LOCALE)/
319         @scripts/merge_ils_events.py --master $(EVTSRC) --localization $(PROJECT)/$(LOCALE)/$(EVTXML) --output $(EVTSRC)
320         cp $(PROJECT)/$(LOCALE)/$(SQLOUT).sql $(SQLSRCDIR)/$(SQLOUT)-$(LOCALE).sql
321         cp $(PO)/$(FMIDLENT) $(REPORTDIR)/$(FMIDLENT)
322         mkdir -p $(DOJO_ACQ_SRC)/$(DOJO_LOCALE)
323         cp $(PROJECT)/$(LOCALE)/acq.js $(DOJO_ACQ_SRC)/$(DOJO_LOCALE)/acq.js
324         mkdir -p $(DOJO_ACTOR_SRC)/$(DOJO_LOCALE)
325         cp $(PROJECT)/$(LOCALE)/register.js $(DOJO_ACTOR_SRC)/$(DOJO_LOCALE)/register.js
326         mkdir -p $(DOJO_AUTHORITY_SRC)/$(DOJO_LOCALE)
327         cp $(PROJECT)/$(LOCALE)/authority.js $(DOJO_AUTHORITY_SRC)/$(DOJO_LOCALE)/authority.js
328         mkdir -p $(DOJO_BOOKING_SRC)/$(DOJO_LOCALE)
329         cp $(PROJECT)/$(LOCALE)/capture.js $(DOJO_BOOKING_SRC)/$(DOJO_LOCALE)/capture.js
330         cp $(PROJECT)/$(LOCALE)/pickup_and_return.js $(DOJO_BOOKING_SRC)/$(DOJO_LOCALE)/pickup_and_return.js
331         cp $(PROJECT)/$(LOCALE)/pull_list.js $(DOJO_BOOKING_SRC)/$(DOJO_LOCALE)/pull_list.js
332         cp $(PROJECT)/$(LOCALE)/reservation.js $(DOJO_BOOKING_SRC)/$(DOJO_LOCALE)/reservation.js
333         mkdir -p $(DOJO_CIRC_SRC)/$(DOJO_LOCALE)
334         cp $(PROJECT)/$(LOCALE)/selfcheck.js $(DOJO_CIRC_SRC)/$(DOJO_LOCALE)/selfcheck.js
335         mkdir -p $(DOJO_CON_SRC)/$(DOJO_LOCALE)
336         cp $(PROJECT)/$(LOCALE)/conify.js $(DOJO_CON_SRC)/$(DOJO_LOCALE)/conify.js
337         mkdir -p $(DOJO_OPAC_SRC)/$(DOJO_LOCALE)
338         cp $(PROJECT)/$(LOCALE)/opac.js $(DOJO_OPAC_SRC)/$(DOJO_LOCALE)/opac.js
339         mkdir -p $(DOJO_RPT_SRC)/$(DOJO_LOCALE)
340         cp $(PROJECT)/$(LOCALE)/reports.js $(DOJO_RPT_SRC)/$(DOJO_LOCALE)/reports.js
341         mkdir -p $(DOJO_USER_SRC)/$(DOJO_LOCALE)
342         cp $(PROJECT)/$(LOCALE)/User.js $(DOJO_USER_SRC)/$(DOJO_LOCALE)/User.js
343         mkdir -p $(DOJO_SERIAL_SRC)/$(DOJO_LOCALE)
344         cp $(PROJECT)/$(LOCALE)/serial.js $(DOJO_SERIAL_SRC)/$(DOJO_LOCALE)/serial.js
345         mkdir -p $(DOJO_URLVERIFY_SRC)/$(DOJO_LOCALE)
346         cp $(PROJECT)/$(LOCALE)/URLVerify.js $(DOJO_URLVERIFY_SRC)/$(DOJO_LOCALE)/URLVerify.js
347         mkdir -p $(DOJO_VANDELAY_SRC)/$(DOJO_LOCALE)
348         cp $(PROJECT)/$(LOCALE)/match_set.js $(DOJO_VANDELAY_SRC)/$(DOJO_LOCALE)/match_set.js
349         cp $(PROJECT)/$(LOCALE)/vandelay.js $(DOJO_VANDELAY_SRC)/$(DOJO_LOCALE)/vandelay.js
350         mkdir -p $(DOJO_WIDGET_SRC)/$(DOJO_LOCALE)
351         cp $(PROJECT)/$(LOCALE)/AutoFieldWidget.js $(DOJO_WIDGET_SRC)/$(DOJO_LOCALE)/AutoFieldWidget.js
352         cp $(PROJECT)/$(LOCALE)/FlattenerGrid.js $(DOJO_WIDGET_SRC)/$(DOJO_LOCALE)/FlattenerGrid.js
353         cp $(PROJECT)/$(LOCALE)/PCrudFilterPane.js $(DOJO_WIDGET_SRC)/$(DOJO_LOCALE)/PCrudFilterPane.js
354         cp $(PROJECT)/$(LOCALE)/Searcher.js $(DOJO_WIDGET_SRC)/$(DOJO_LOCALE)/Searcher.js
355         cp $(PROJECT)/$(LOCALE)/TranslatorPopup.js $(DOJO_WIDGET_SRC)/$(DOJO_LOCALE)/TranslatorPopup.js
356         cp $(PROJECT)/$(LOCALE)/XULTermLoader.js $(DOJO_WIDGET_SRC)/$(DOJO_LOCALE)/XULTermLoader.js
357         mkdir -p $(TT2_DATA_DIR)
358         cp $(PO)/tpac/$(LOCALE).po $(TT2_DATA_DIR)/.
359
360 install_all_locales: newpot
361         for i in `ls po/*/*po|grep -v en-US | cut -f3 -d'/' | cut -f1 -d. | sort | uniq`; \
362         do \
363         make LOCALE=$$i install; \
364         RC=$$?; \
365         if [ "$$RC" -gt 0 ]; \
366         then echo $$RC; exit $$RC; \
367         fi; done
368
369 update_all_locales: newpot
370         for i in `ls po/*/*po|grep -v en-US | cut -f3 -d'/' | cut -f1 -d. | sort | uniq`; \
371         do \
372         make LOCALE=$$i updatepo; \
373         RC=$$?; \
374         if [ "$$RC" -gt 0 ]; \
375         then echo $$RC; exit $$RC; \
376         fi; done