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 FMIDLSRC=../../Open-ILS/examples/fm_IDL.xml
12 FMIDLENTITY=fm_IDL.dtd
14 EVTSRC=../../Open-ILS/src/extras/ils_events.xml
15 EVTOUT=ils_events.xml.pot
16 EVTPO=ils_events.xml.po
18 REPORTDIR=../../Open-ILS/web/reports/
19 SQLSRCDIR=../../Open-ILS/src/sql/Pg/
20 SQLSRCFILE=950.data.seed-values.sql
23 SQLOUT=950.data.seed-values
24 PROGRESS=--progress none
26 # This Makefile can be used to generate and update PO files for Evergreen,
27 # as well as generate updated SQL, fieldmapper IDL, DTD and JavaScript
28 # property files from the PO.
32 # To create a new set of untranslated PO files for locale ll-LL:
33 # make LOCALE=ll-LL newpo
35 # To create a new set of POT files from the en-US source:
36 # make LOCALE=ll-LL newpot
38 # To update a set of translated PO files with new or changed en-US strings:
39 # make LOCALE=ll-LL updatepo
41 # To create a set of translated project files (DTDs, JavaScript message catalogs):
42 # make LOCALE=ll-LL project
44 # To install a set of translated project files:
45 # make LOCALE=ll-LL install
47 # Generate PO files from all POT files in POOUTDIR for locale LOCALE
49 @pot2po $(PROGRESS) -i $(POTSRC) -o $(POOUTDIR)/$(LOCALE)
50 @echo "Generated new PO files for locale $(LOCALE)"
52 # Generate a new set of POT files and entityized fieldmapper IDL
53 newpot: dtds2pot fmidl2pot fmidl2fmidlent ils2pot props2pot sql2pot
54 @echo "Generated new POT files"
56 # Generate DTD, JavaScript message catalogs, fieldmapper IDL,
57 # and SQL insert files from PO for locale LOCALE
58 project: po2dtds po2props po2sql fmidlpo2entity po2ils
59 @echo "Generated project files for locale $(LOCALE)"
61 # Update PO files with new and changed strings from POT files
63 pot2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(POTSRC) -t $(POOUTDIR)/$(LOCALE) 2>&1
64 @echo "Updated PO files for locale $(LOCALE)"
66 # Update PO files with new and changed strings from POT files
68 @msgmerge -U $(POOUTDIR)/$(LOCALE)/opac.dtd.po $(POTSRC)/opac.dtd.pot 2>&1
69 @echo "Updated PO file opac.dtd.po for locale $(LOCALE)"
72 @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(DTDDIR)/en-US/ 2>&1
75 @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(CHROME_PROPSDIR)/en-US/ 2>&1
76 @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(SERVER_PROPSDIR)/en-US/ 2>&1
79 @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(DTDDIR)/en-US/ 2>&1
82 @scripts/ils_events.py --pot $(EVTSRC) --output $(POTSRC)/$(EVTOUT)
85 @scripts/ils_events.py --create $(POINDIR)/$(LOCALE)/$(EVTPO) --locale $(LOCALE) --output $(PROJECT)/$(LOCALE)/$(EVTXML)
88 @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(CHROME_PROPSDIR)/en-US/ 2>&1
89 @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(SERVER_PROPSDIR)/en-US/ 2>&1
92 @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(DTDDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
95 @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(CHROME_PROPSDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
96 @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(SERVER_PROPSDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
99 @scripts/db-seed-i18n.py --pot $(SQLSRCDIR)/$(SQLSRCFILE) --output $(POTSRC)/$(SQLPOT)
102 scripts/db-seed-i18n.py --sql $(POINDIR)/$(LOCALE)/$(SQLPO) --locale $(LOCALE) --output $(PROJECT)/$(LOCALE)/$(SQLOUT).sql
104 # Generate a fieldmapper IDL file that uses entities instead of hard-coded strings
106 @scripts/fieldmapper.py --convert $(FMIDLSRC) --output $(POOUTDIR)/$(FMIDLENT)
108 # Generate a POT file for translating the entity values
110 @scripts/fieldmapper.py --pot $(FMIDLSRC) --output $(POTSRC)/$(FMIDLOUT)
112 # Generate a set of entity declarations from a PO file
114 @scripts/fieldmapper.py --entity $(POINDIR)/$(LOCALE)/$(FMIDLPO) --output $(PROJECT)/$(LOCALE)/$(FMIDLENTITY)
116 # Install updated project files to their corresponding location in the source tree
117 install: updatepo project fmidl2fmidlent
118 mkdir -p $(CHROME_PROPSDIR)/$(LOCALE)
119 cp $(PROJECT)/$(LOCALE)/auth.properties $(CHROME_PROPSDIR)/$(LOCALE)/.
120 cp $(PROJECT)/$(LOCALE)/offline.properties $(CHROME_PROPSDIR)/$(LOCALE)/.
121 mkdir -p $(SERVER_PROPSDIR)/$(LOCALE)
122 cp $(PROJECT)/$(LOCALE)/admin.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
123 cp $(PROJECT)/$(LOCALE)/cat.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
124 cp $(PROJECT)/$(LOCALE)/circ.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
125 cp $(PROJECT)/$(LOCALE)/common.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
126 cp $(PROJECT)/$(LOCALE)/multiclass_search_help.html $(SERVER_PROPSDIR)/$(LOCALE)/.
127 cp $(PROJECT)/$(LOCALE)/patron.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
128 mkdir -p $(DTDDIR)/$(LOCALE)
129 cp $(PROJECT)/$(LOCALE)/lang.dtd $(CHROME_PROPSDIR)/$(LOCALE)/
130 cp $(PROJECT)/$(LOCALE)/lang.dtd $(DTDDIR)/$(LOCALE)/
131 cp $(PROJECT)/$(LOCALE)/opac.dtd $(DTDDIR)/$(LOCALE)/
132 cp $(PROJECT)/$(LOCALE)/$(FMIDLENTITY) $(DTDDIR)/$(LOCALE)/
133 @scripts/merge_ils_events.py --master $(EVTSRC) --localization $(PROJECT)/$(LOCALE)/$(EVTXML) --output $(EVTSRC)
134 cp $(PROJECT)/$(LOCALE)/$(SQLOUT).sql $(SQLSRCDIR)/$(SQLOUT)-$(LOCALE).sql
135 cp $(POOUTDIR)/$(FMIDLENT) $(REPORTDIR)/$(FMIDLENT)