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_RPT_SRC=../../Open-ILS/web/js/dojo/openils/reports/nls
12 FMIDLSRC=../../Open-ILS/examples/fm_IDL.xml
15 FMIDLENTITY=fm_IDL.dtd
17 EVTSRC=../../Open-ILS/src/extras/ils_events.xml
18 EVTOUT=ils_events.xml.pot
19 EVTPO=ils_events.xml.po
21 REPORTDIR=../../Open-ILS/web/reports/
22 SQLSRCDIR=../../Open-ILS/src/sql/Pg/
23 SQLSRCFILE=950.data.seed-values.sql
26 SQLOUT=950.data.seed-values
27 PROGRESS=--progress none
29 # This Makefile can be used to generate and update PO files for Evergreen,
30 # as well as generate updated SQL, fieldmapper IDL, DTD and JavaScript
31 # property files from the PO.
35 # To create a new set of untranslated PO files for locale ll-LL:
36 # make LOCALE=ll-LL newpo
38 # To create a new set of POT files from the en-US source:
39 # make LOCALE=ll-LL newpot
41 # To update a set of translated PO files with new or changed en-US strings:
42 # make LOCALE=ll-LL updatepo
44 # To create a set of translated project files (DTDs, JavaScript message catalogs):
45 # make LOCALE=ll-LL project
47 # To install a set of translated project files:
48 # make LOCALE=ll-LL install
50 # Generate PO files from all POT files in POOUTDIR for locale LOCALE
52 @pot2po $(PROGRESS) -i $(POTSRC) -o $(POOUTDIR)/$(LOCALE)
53 @echo "Generated new PO files for locale $(LOCALE)"
55 # Generate a new set of POT files and entityized fieldmapper IDL
56 newpot: dtds2pot fmidl2pot fmidl2fmidlent ils2pot props2pot sql2pot dojo2pot
57 @echo "Generated new POT files"
59 # Generate DTD, JavaScript message catalogs, fieldmapper IDL,
60 # and SQL insert files from PO for locale LOCALE
61 project: po2dtds po2props po2sql fmidlpo2entity po2ils po2dojo
62 @echo "Generated project files for locale $(LOCALE)"
64 # Update PO files with new and changed strings from POT files
66 pot2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(POTSRC) -t $(POOUTDIR)/$(LOCALE) 2>&1
67 @echo "Updated PO files for locale $(LOCALE)"
69 # Update PO files with new and changed strings from POT files
71 @msgmerge -U $(POOUTDIR)/$(LOCALE)/opac.dtd.po $(POTSRC)/opac.dtd.pot 2>&1
72 @echo "Updated PO file opac.dtd.po for locale $(LOCALE)"
75 @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(DTDDIR)/en-US/ 2>&1
78 @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(CHROME_PROPSDIR)/en-US/ 2>&1
79 @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(SERVER_PROPSDIR)/en-US/ 2>&1
82 @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(DTDDIR)/en-US/ 2>&1
85 @scripts/dojo_resource.py --pot $(DOJO_CON_SRC)/conify.js --output $(POTSRC)/conify.js.pot
86 @scripts/dojo_resource.py --pot $(DOJO_RPT_SRC)/reports.js --output $(POTSRC)/reports.js.pot
89 @scripts/dojo_resource.py --create $(POINDIR)/$(LOCALE)/conify.js.po --output $(PROJECT)/$(LOCALE)/conify.js
90 @scripts/dojo_resource.py --create $(POINDIR)/$(LOCALE)/reports.js.po --output $(PROJECT)/$(LOCALE)/reports.js
93 @scripts/ils_events.py --pot $(EVTSRC) --output $(POTSRC)/$(EVTOUT)
96 @scripts/ils_events.py --create $(POINDIR)/$(LOCALE)/$(EVTPO) --locale $(LOCALE) --output $(PROJECT)/$(LOCALE)/$(EVTXML)
99 @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(CHROME_PROPSDIR)/en-US/ 2>&1
100 @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(SERVER_PROPSDIR)/en-US/ 2>&1
103 @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(DTDDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
106 @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(CHROME_PROPSDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
107 @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(SERVER_PROPSDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
110 @scripts/db-seed-i18n.py --pot $(SQLSRCDIR)/$(SQLSRCFILE) --output $(POTSRC)/$(SQLPOT)
111 # @msghack --empty -o $(POTSRC)/$(SQLPOT) $(POTSRC)/$(SQLPOT)
114 scripts/db-seed-i18n.py --sql $(POINDIR)/$(LOCALE)/$(SQLPO) --locale $(LOCALE) --output $(PROJECT)/$(LOCALE)/$(SQLOUT).sql
116 # Generate a fieldmapper IDL file that uses entities instead of hard-coded strings
118 @scripts/fieldmapper.py --convert $(FMIDLSRC) --output $(POOUTDIR)/$(FMIDLENT)
120 # Generate a POT file for translating the entity values
122 @scripts/fieldmapper.py --pot $(FMIDLSRC) --output $(POTSRC)/$(FMIDLOUT)
124 # Generate a set of entity declarations from a PO file
126 @scripts/fieldmapper.py --entity $(POINDIR)/$(LOCALE)/$(FMIDLPO) --output $(PROJECT)/$(LOCALE)/$(FMIDLENTITY)
128 # Generate en-US DTD from a POT file; required if any other locale is installed
130 mkdir -p $(PROJECT)/en-US
131 @scripts/fieldmapper.py --entity $(POINDIR)/en-US/$(FMIDLOUT) --output $(PROJECT)/en-US/$(FMIDLENTITY)
132 cp $(PROJECT)/en-US/$(FMIDLENTITY) $(DTDDIR)/en-US/
134 # Install updated project files to their corresponding location in the source tree
135 install: updatepo project fmidl2fmidlent fmidlpo2entity-en
136 mkdir -p $(CHROME_PROPSDIR)/$(LOCALE)
137 cp $(PROJECT)/$(LOCALE)/auth.properties $(CHROME_PROPSDIR)/$(LOCALE)/.
138 cp $(PROJECT)/$(LOCALE)/offline.properties $(CHROME_PROPSDIR)/$(LOCALE)/.
139 mkdir -p $(SERVER_PROPSDIR)/$(LOCALE)
140 cp $(PROJECT)/$(LOCALE)/admin.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
141 cp $(PROJECT)/$(LOCALE)/cat.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
142 cp $(PROJECT)/$(LOCALE)/circ.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
143 cp $(PROJECT)/$(LOCALE)/common.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
144 cp $(PROJECT)/$(LOCALE)/multiclass_search_help.html $(SERVER_PROPSDIR)/$(LOCALE)/.
145 cp $(PROJECT)/$(LOCALE)/patron.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
146 mkdir -p $(DTDDIR)/$(LOCALE)
147 cp $(PROJECT)/$(LOCALE)/conify.dtd $(DTDDIR)/$(LOCALE)/
148 cp $(PROJECT)/$(LOCALE)/lang.dtd $(CHROME_PROPSDIR)/$(LOCALE)/
149 cp $(PROJECT)/$(LOCALE)/lang.dtd $(DTDDIR)/$(LOCALE)/
150 cp $(PROJECT)/$(LOCALE)/opac.dtd $(DTDDIR)/$(LOCALE)/
151 cp $(PROJECT)/$(LOCALE)/reports.dtd $(DTDDIR)/$(LOCALE)/
152 cp $(PROJECT)/$(LOCALE)/vandelay.dtd $(DTDDIR)/$(LOCALE)/
153 cp $(PROJECT)/$(LOCALE)/$(FMIDLENTITY) $(DTDDIR)/$(LOCALE)/
154 @scripts/merge_ils_events.py --master $(EVTSRC) --localization $(PROJECT)/$(LOCALE)/$(EVTXML) --output $(EVTSRC)
155 cp $(PROJECT)/$(LOCALE)/$(SQLOUT).sql $(SQLSRCDIR)/$(SQLOUT)-$(LOCALE).sql
156 cp $(POOUTDIR)/$(FMIDLENT) $(REPORTDIR)/$(FMIDLENT)
157 mkdir -p $(DOJO_CON_SRC)/$(DOJO_LOCALE)
158 cp $(PROJECT)/$(LOCALE)/conify.js $(DOJO_CON_SRC)/$(DOJO_LOCALE)/conify.js
159 mkdir -p $(DOJO_RPT_SRC)/$(DOJO_LOCALE)
160 cp $(PROJECT)/$(LOCALE)/reports.js $(DOJO_RPT_SRC)/$(DOJO_LOCALE)/reports.js