]> git.evergreen-ils.org Git - Evergreen.git/blob - build/i18n/Makefile
Move POT files into en-US subdirectory (clutter BAD).
[Evergreen.git] / build / i18n / Makefile
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 PROPSDIR=../../Open-ILS/xul/staff_client/chrome/locale
8 FMIDLSRC=../../Open-ILS/examples/fm_IDL.xml
9 FMIDLOUT=fm_IDL.pot
10 FMIDLENT=fm_IDL.xml
11 FMIDLENTITY=fm_IDL.xml.ent
12 FMIDLPO=fm_IDL.po
13 EVTSRC=../../Open-ILS/src/extras/ils_events.xml
14 EVTOUT=ils_events.xml.pot
15 EVTPO=ils_events.xml.po
16 EVTXML=ils_events.xml
17 SQLSRC=../../Open-ILS/src/sql/Pg/950.data.seed-values.sql
18 SQLPOT=db.seed.pot
19 SQLPO=db.seed.po
20 SQLOUT=950.data.seed-values.sql
21 PROGRESS=--progress none
22
23 # This Makefile can be used to generate and update PO files for Evergreen,
24 # as well as generate updated SQL, fieldmapper IDL, DTD and JavaScript
25 # property files from the PO.
26 #
27 # Usage:
28 #
29 # To create a new set of untranslated PO files for locale ll-LL:
30 #   make LOCALE=ll-LL newpo
31 #
32 # To create a new set of POT files from the en-US source:
33 #   make LOCALE=ll-LL newpot
34 #
35 # To update a set of translated PO files with new or changed en-US strings:
36 #   make LOCALE=ll-LL updatepo
37 #
38 # To create a new set of project files (DTDs, JavaScript message catalogs):
39 #   make LOCALE=ll-LL updatepo
40
41 # Generate PO files from all POT files in POOUTDIR for locale LOCALE
42 newpo: 
43         @pot2po $(PROGRESS) -i $(POTSRC) -o $(POOUTDIR)/$(LOCALE) 
44         @echo "Generated new PO files for locale $(LOCALE)"
45
46 # Generate a new set of POT files and entityized fieldmapper IDL
47 newpot: dtds2pot fmidl2pot fmidl2fmidlent ils2pot props2pot sql2pot
48         @echo "Generated new POT files"
49
50 # Generate DTD, JavaScript message catalogs, fieldmapper IDL,
51 # and SQL insert files from PO for locale LOCALE
52 newproject: po2dtds po2props po2sql fmidlpo2entity po2ils
53         @echo "Generated project files for locale $(LOCALE)"
54
55 # Update PO files with new and changed strings from POT files
56 updatepo: 
57         pot2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(POTSRC) -t $(POOUTDIR)/$(LOCALE) 2>&1
58         @echo "Updated PO files for locale $(LOCALE)"
59
60 # Update PO files with new and changed strings from POT files
61 updateopac: 
62         @msgmerge -U $(POOUTDIR)/$(LOCALE)/opac.dtd.po $(POTSRC)/opac.dtd.pot 2>&1
63         @echo "Updated PO file opac.dtd.po for locale $(LOCALE)"
64
65 dtds2po:
66         @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(DTDDIR)/en-US/ 2>&1
67
68 props2po:
69         @moz2po $(PROGRESS) -o $(POOUTDIR)/$(LOCALE) -i $(PROPSDIR)/en-US/ 2>&1
70
71 dtds2pot:
72         @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(DTDDIR)/en-US/ 2>&1
73
74 ils2pot:
75         @scripts/ils_events.py --pot $(EVTSRC) --output $(POTSRC)/$(EVTOUT)
76
77 po2ils:
78         @scripts/ils_events.py --create $(POINDIR)/$(LOCALE)/$(EVTPO) --locale $(LOCALE) --output $(PROJECT)/$(LOCALE)/$(EVTXML) 
79
80 props2pot:
81         @moz2po -P $(PROGRESS) -o $(POTSRC) -i $(PROPSDIR)/en-US/ 2>&1
82
83 po2dtds:
84         @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(DTDDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
85
86 po2props:
87         @po2moz $(PROGRESS) -o $(PROJECT)/$(LOCALE) -t $(PROPSDIR)/en-US/ -i $(POINDIR)/$(LOCALE) 2>&1
88
89 sql2pot:
90         @scripts/db-seed-i18n.py --pot $(SQLSRC) --output $(POTSRC)/$(SQLPOT)
91
92 po2sql:
93         scripts/db-seed-i18n.py --sql $(POINDIR)/$(LOCALE)/$(SQLPO) --locale $(LOCALE) --output $(PROJECT)/$(LOCALE)/$(SQLOUT)
94
95 # Generate a fieldmapper IDL file that uses entities instead of hard-coded strings
96 fmidl2fmidlent:
97         @scripts/fieldmapper.py --convert $(FMIDLSRC) --output $(POOUTDIR)/$(FMIDLENT)
98
99 # Generate a POT file for translating the entity values
100 fmidl2pot:
101         @scripts/fieldmapper.py --pot $(FMIDLSRC) --output $(POTSRC)/$(FMIDLOUT)
102
103 # Generate a set of entity declarations from a PO file
104 fmidlpo2entity:
105         @scripts/fieldmapper.py --entity $(POINDIR)/$(LOCALE)/$(FMIDLPO) --output $(PROJECT)/$(LOCALE)/$(FMIDLENTITY)