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.xml.ent
14 EVTSRC=../../Open-ILS/src/extras/ils_events.xml
15 EVTOUT=ils_events.xml.pot
16 EVTPO=ils_events.xml.po
18 SQLSRCDIR=../../Open-ILS/src/sql/Pg/
19 SQLSRCFILE=950.data.seed-values.sql
22 SQLOUT=950.data.seed-values
23 PROGRESS=--progress none
25 # This Makefile can be used to generate and update PO files for Evergreen,
26 # as well as generate updated SQL, fieldmapper IDL, DTD and JavaScript
27 # property files from the PO.
31 # To create a new set of untranslated PO files for locale ll-LL:
32 # make LOCALE=ll-LL newpo
34 # To create a new set of POT files from the en-US source:
35 # make LOCALE=ll-LL newpot
37 # To update a set of translated PO files with new or changed en-US strings:
38 # make LOCALE=ll-LL updatepo
40 # To create a set of translated project files (DTDs, JavaScript message catalogs):
41 # make LOCALE=ll-LL project
43 # To install a set of translated project files:
44 # make LOCALE=ll-LL install
46 # Generate PO files from all POT files in POOUTDIR for locale LOCALE
48 @pot2po $(PROGRESS) -i $(POTSRC) -o $(POOUTDIR)/$(LOCALE)
49 @echo "Generated new PO files for locale $(LOCALE)"
51 # Generate a new set of POT files and entityized fieldmapper IDL
52 newpot: dtds2pot fmidl2pot fmidl2fmidlent ils2pot props2pot sql2pot
53 @echo "Generated new POT files"
55 # Generate DTD, JavaScript message catalogs, fieldmapper IDL,
56 # and SQL insert files from PO for locale LOCALE
57 project: po2dtds po2props po2sql fmidlpo2entity po2ils
58 @echo "Generated project files for locale $(LOCALE)"
60 # Update PO files with new and changed strings from POT files
62 pot2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(POTSRC) -t $(POOUTDIR)/$(LOCALE) 2>&1
63 @echo "Updated PO files for locale $(LOCALE)"
65 # Update PO files with new and changed strings from POT files
67 @msgmerge -U $(POOUTDIR)/$(LOCALE)/opac.dtd.po $(POTSRC)/opac.dtd.pot 2>&1
68 @echo "Updated PO file opac.dtd.po for locale $(LOCALE)"
71 @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(DTDDIR)/en-US/ 2>&1
74 @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(CHROME_PROPSDIR)/en-US/ 2>&1
75 @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(SERVER_PROPSDIR)/en-US/ 2>&1
78 @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(DTDDIR)/en-US/ 2>&1
81 @scripts/ils_events.py --pot $(EVTSRC) --output $(POTSRC)/$(EVTOUT)
84 @scripts/ils_events.py --create $(POINDIR)/$(LOCALE)/$(EVTPO) --locale $(LOCALE) --output $(PROJECT)/$(LOCALE)/$(EVTXML)
87 @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(CHROME_PROPSDIR)/en-US/ 2>&1
88 @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(SERVER_PROPSDIR)/en-US/ 2>&1
91 @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(DTDDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
94 @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(CHROME_PROPSDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
95 @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(SERVER_PROPSDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
98 @scripts/db-seed-i18n.py --pot $(SQLSRCDIR)/$(SQLSRCFILE) --output $(POTSRC)/$(SQLPOT)
101 scripts/db-seed-i18n.py --sql $(POINDIR)/$(LOCALE)/$(SQLPO) --locale $(LOCALE) --output $(PROJECT)/$(LOCALE)/$(SQLOUT).sql
103 # Generate a fieldmapper IDL file that uses entities instead of hard-coded strings
105 @scripts/fieldmapper.py --convert $(FMIDLSRC) --output $(POOUTDIR)/$(FMIDLENT)
107 # Generate a POT file for translating the entity values
109 @scripts/fieldmapper.py --pot $(FMIDLSRC) --output $(POTSRC)/$(FMIDLOUT)
111 # Generate a set of entity declarations from a PO file
113 @scripts/fieldmapper.py --entity $(POINDIR)/$(LOCALE)/$(FMIDLPO) --output $(PROJECT)/$(LOCALE)/$(FMIDLENTITY)
115 # Install updated project files to their corresponding location in the source tree
116 install: updatepo project
117 mkdir -p $(CHROME_PROPSDIR)/$(LOCALE)
118 cp $(PROJECT)/$(LOCALE)/auth.properties $(CHROME_PROPSDIR)/$(LOCALE)/.
119 cp $(PROJECT)/$(LOCALE)/offline.properties $(CHROME_PROPSDIR)/$(LOCALE)/.
120 mkdir -p $(SERVER_PROPSDIR)/$(LOCALE)
121 cp $(PROJECT)/$(LOCALE)/admin.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
122 cp $(PROJECT)/$(LOCALE)/cat.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
123 cp $(PROJECT)/$(LOCALE)/circ.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
124 cp $(PROJECT)/$(LOCALE)/common.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
125 cp $(PROJECT)/$(LOCALE)/multiclass_search_help.html $(SERVER_PROPSDIR)/$(LOCALE)/.
126 cp $(PROJECT)/$(LOCALE)/patron.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
127 mkdir -p $(DTDDIR)/$(LOCALE)
128 cp $(PROJECT)/$(LOCALE)/lang.dtd $(CHROME_PROPSDIR)/$(LOCALE)/
129 cp $(PROJECT)/$(LOCALE)/lang.dtd $(DTDDIR)/$(LOCALE)/
130 cp $(PROJECT)/$(LOCALE)/opac.dtd $(DTDDIR)/$(LOCALE)/
131 @scripts/merge_ils_events.py --master $(EVTSRC) --localization $(PROJECT)/$(LOCALE)/$(EVTXML) --output $(EVTSRC)
132 cp $(PROJECT)/$(LOCALE)/$(SQLOUT).sql $(SQLSRCDIR)/$(SQLOUT)-$(LOCALE).sql