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