]> git.evergreen-ils.org Git - Evergreen.git/blob - build/i18n/Makefile.in
build/i18n/Makefile.in:
[Evergreen.git] / build / i18n / Makefile.in
1 POTSRC=po/en-US
2 POOUTDIR=po
3 POINDIR=po
4 PROJECT=locale
5 LOCALE=fr-CA
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
10 FMIDLOUT=fm_IDL.pot
11 FMIDLENT=fm_IDL.xml
12 FMIDLENTITY=fm_IDL.dtd
13 FMIDLPO=fm_IDL.po
14 EVTSRC=../../Open-ILS/src/extras/ils_events.xml
15 EVTOUT=ils_events.xml.pot
16 EVTPO=ils_events.xml.po
17 EVTXML=ils_events.xml
18 REPORTDIR=../../Open-ILS/web/reports/
19 SQLSRCDIR=../../Open-ILS/src/sql/Pg/
20 SQLSRCFILE=950.data.seed-values.sql
21 SQLPOT=db.seed.pot
22 SQLPO=db.seed.po
23 SQLOUT=950.data.seed-values
24 PROGRESS=--progress none
25
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.
29 #
30 # Usage:
31 #
32 # To create a new set of untranslated PO files for locale ll-LL:
33 #   make LOCALE=ll-LL newpo
34 #
35 # To create a new set of POT files from the en-US source:
36 #   make LOCALE=ll-LL newpot
37 #
38 # To update a set of translated PO files with new or changed en-US strings:
39 #   make LOCALE=ll-LL updatepo
40 #
41 # To create a set of translated project files (DTDs, JavaScript message catalogs):
42 #   make LOCALE=ll-LL project
43 #
44 # To install a set of translated project files:
45 #   make LOCALE=ll-LL install
46
47 # Generate PO files from all POT files in POOUTDIR for locale LOCALE
48 newpo: 
49         @pot2po $(PROGRESS) -i $(POTSRC) -o $(POOUTDIR)/$(LOCALE) 
50         @echo "Generated new PO files for locale $(LOCALE)"
51
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"
55
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)"
60
61 # Update PO files with new and changed strings from POT files
62 updatepo: 
63         pot2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(POTSRC) -t $(POOUTDIR)/$(LOCALE) 2>&1
64         @echo "Updated PO files for locale $(LOCALE)"
65
66 # Update PO files with new and changed strings from POT files
67 updateopac: 
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)"
70
71 dtds2po:
72         @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(DTDDIR)/en-US/ 2>&1
73
74 props2po:
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
77
78 dtds2pot:
79         @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(DTDDIR)/en-US/ 2>&1
80
81 ils2pot:
82         @scripts/ils_events.py --pot $(EVTSRC) --output $(POTSRC)/$(EVTOUT)
83
84 po2ils:
85         @scripts/ils_events.py --create $(POINDIR)/$(LOCALE)/$(EVTPO) --locale $(LOCALE) --output $(PROJECT)/$(LOCALE)/$(EVTXML) 
86
87 props2pot:
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
90
91 po2dtds:
92         @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(DTDDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
93
94 po2props:
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
97
98 sql2pot:
99         @scripts/db-seed-i18n.py --pot $(SQLSRCDIR)/$(SQLSRCFILE) --output $(POTSRC)/$(SQLPOT)
100
101 po2sql:
102         scripts/db-seed-i18n.py --sql $(POINDIR)/$(LOCALE)/$(SQLPO) --locale $(LOCALE) --output $(PROJECT)/$(LOCALE)/$(SQLOUT).sql
103
104 # Generate a fieldmapper IDL file that uses entities instead of hard-coded strings
105 fmidl2fmidlent:
106         @scripts/fieldmapper.py --convert $(FMIDLSRC) --output $(POOUTDIR)/$(FMIDLENT)
107
108 # Generate a POT file for translating the entity values
109 fmidl2pot:
110         @scripts/fieldmapper.py --pot $(FMIDLSRC) --output $(POTSRC)/$(FMIDLOUT)
111
112 # Generate a set of entity declarations from a PO file
113 fmidlpo2entity:
114         @scripts/fieldmapper.py --entity $(POINDIR)/$(LOCALE)/$(FMIDLPO) --output $(PROJECT)/$(LOCALE)/$(FMIDLENTITY)
115
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)