]> git.evergreen-ils.org Git - Evergreen.git/blob - build/i18n/Makefile.in
30d2e687c8fef74af399b31516a8330370bae373
[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.xml.ent
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 SQLSRC=../../Open-ILS/src/sql/Pg/950.data.seed-values.sql
19 SQLPOT=db.seed.pot
20 SQLPO=db.seed.po
21 SQLOUT=950.data.seed-values.sql
22 PROGRESS=--progress none
23
24 # This Makefile can be used to generate and update PO files for Evergreen,
25 # as well as generate updated SQL, fieldmapper IDL, DTD and JavaScript
26 # property files from the PO.
27 #
28 # Usage:
29 #
30 # To create a new set of untranslated PO files for locale ll-LL:
31 #   make LOCALE=ll-LL newpo
32 #
33 # To create a new set of POT files from the en-US source:
34 #   make LOCALE=ll-LL newpot
35 #
36 # To update a set of translated PO files with new or changed en-US strings:
37 #   make LOCALE=ll-LL updatepo
38 #
39 # To create a set of translated project files (DTDs, JavaScript message catalogs):
40 #   make LOCALE=ll-LL project
41 #
42 # To install a set of translated project files:
43 #   make LOCALE=ll-LL install
44
45 # Generate PO files from all POT files in POOUTDIR for locale LOCALE
46 newpo: 
47         @pot2po $(PROGRESS) -i $(POTSRC) -o $(POOUTDIR)/$(LOCALE) 
48         @echo "Generated new PO files for locale $(LOCALE)"
49
50 # Generate a new set of POT files and entityized fieldmapper IDL
51 newpot: dtds2pot fmidl2pot fmidl2fmidlent ils2pot props2pot sql2pot
52         @echo "Generated new POT files"
53
54 # Generate DTD, JavaScript message catalogs, fieldmapper IDL,
55 # and SQL insert files from PO for locale LOCALE
56 project: po2dtds po2props po2sql fmidlpo2entity po2ils
57         @echo "Generated project files for locale $(LOCALE)"
58
59 # Update PO files with new and changed strings from POT files
60 updatepo: 
61         pot2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(POTSRC) -t $(POOUTDIR)/$(LOCALE) 2>&1
62         @echo "Updated PO files for locale $(LOCALE)"
63
64 # Update PO files with new and changed strings from POT files
65 updateopac: 
66         @msgmerge -U $(POOUTDIR)/$(LOCALE)/opac.dtd.po $(POTSRC)/opac.dtd.pot 2>&1
67         @echo "Updated PO file opac.dtd.po for locale $(LOCALE)"
68
69 dtds2po:
70         @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(DTDDIR)/en-US/ 2>&1
71
72 props2po:
73         @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(CHROME_PROPSDIR)/en-US/ 2>&1
74         @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(SERVER_PROPSDIR)/en-US/ 2>&1
75
76 dtds2pot:
77         @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(DTDDIR)/en-US/ 2>&1
78
79 ils2pot:
80         @scripts/ils_events.py --pot $(EVTSRC) --output $(POTSRC)/$(EVTOUT)
81
82 po2ils:
83         @scripts/ils_events.py --create $(POINDIR)/$(LOCALE)/$(EVTPO) --locale $(LOCALE) --output $(PROJECT)/$(LOCALE)/$(EVTXML) 
84
85 props2pot:
86         @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(CHROME_PROPSDIR)/en-US/ 2>&1
87         @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(SERVER_PROPSDIR)/en-US/ 2>&1
88
89 po2dtds:
90         @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(DTDDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
91
92 po2props:
93         @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(CHROME_PROPSDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
94         @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(SERVER_PROPSDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
95
96 sql2pot:
97         @scripts/db-seed-i18n.py --pot $(SQLSRC) --output $(POTSRC)/$(SQLPOT)
98
99 po2sql:
100         scripts/db-seed-i18n.py --sql $(POINDIR)/$(LOCALE)/$(SQLPO) --locale $(LOCALE) --output $(PROJECT)/$(LOCALE)/$(SQLOUT)
101
102 # Generate a fieldmapper IDL file that uses entities instead of hard-coded strings
103 fmidl2fmidlent:
104         @scripts/fieldmapper.py --convert $(FMIDLSRC) --output $(POOUTDIR)/$(FMIDLENT)
105
106 # Generate a POT file for translating the entity values
107 fmidl2pot:
108         @scripts/fieldmapper.py --pot $(FMIDLSRC) --output $(POTSRC)/$(FMIDLOUT)
109
110 # Generate a set of entity declarations from a PO file
111 fmidlpo2entity:
112         @scripts/fieldmapper.py --entity $(POINDIR)/$(LOCALE)/$(FMIDLPO) --output $(PROJECT)/$(LOCALE)/$(FMIDLENTITY)
113
114 # Install updated project files to their corresponding location in the source tree
115 install: updatepo project 
116         mkdir -p $(CHROME_PROPSDIR)/$(LOCALE)
117         cp $(PROJECT)/$(LOCALE)/auth.properties $(CHROME_PROPSDIR)/$(LOCALE)/.
118         cp $(PROJECT)/$(LOCALE)/offline.properties $(CHROME_PROPSDIR)/$(LOCALE)/.
119         mkdir -p $(SERVER_PROPSDIR)/$(LOCALE)
120         cp $(PROJECT)/$(LOCALE)/admin.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
121         cp $(PROJECT)/$(LOCALE)/cat.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
122         cp $(PROJECT)/$(LOCALE)/circ.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
123         cp $(PROJECT)/$(LOCALE)/common.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
124         cp $(PROJECT)/$(LOCALE)/multiclass_search_help.html $(SERVER_PROPSDIR)/$(LOCALE)/.
125         cp $(PROJECT)/$(LOCALE)/patron.properties $(SERVER_PROPSDIR)/$(LOCALE)/.
126         mkdir -p $(DTDDIR)/$(LOCALE)
127         cp $(PROJECT)/$(LOCALE)/lang.dtd $(CHROME_PROPSDIR)/$(LOCALE)/
128         cp $(PROJECT)/$(LOCALE)/lang.dtd $(DTDDIR)/$(LOCALE)/
129         cp $(PROJECT)/$(LOCALE)/opac.dtd $(DTDDIR)/$(LOCALE)/
130