forked from Gnucash/gnucash-htdocs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
79 lines (63 loc) · 2.24 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
iso_languages = de es fr
languages = ${iso_languages} ca he hr hu id it ja nb nl pl pt zh_CN zh_TW
# keep the languages synchron with <span id="language"> in external/header.phtml
.SECONDEXPANSION:
.PHONY: check pot mos msgmerge ${languages} nmz nmz.lang nmz nmz.onefile nmz.locale
check:
# Currently only our working files
( find . -type f \( -name '*.php' -o -name '*.phtml' \) -exec php -l '{}' \; )
pot: po/POTFILES po/gnucash-htdocs.pot
po/POTFILES: .potfiles
( find . -maxdepth 1 -type f -name '*.php' -o -name '*.phtml'; find externals -name '*.php' -o -name '*.phtml'; ) > po/POTFILES
.potfiles:
po/gnucash-htdocs.pot: po/POTFILES
xgettext -f po/POTFILES -L PHP --keyword="T_" -o po/gnucash-htdocs.pot -F -c \
--from-code=UTF-8 \
--add-comments=Translators \
--package-name=gnucash-htdocs \
--copyright-holder="The GnuCash Website Team" \
--msgid-bugs-address='https://bugs.gnucash.org/buglist.cgi?component=Translations&product=Website&resolution=---'
msgmerge: po/gnucash-htdocs.pot
for f in ${languages} ; do \
echo -n $$f ; \
msgmerge -F --backup=off --previous -U po/$$f.po po/gnucash-htdocs.pot ; \
done
mos: ${languages}
${languages}: po/[email protected]
mkdir -p locale/$@/LC_MESSAGES ;
msgfmt -c --statistics $< -o locale/$@/LC_MESSAGES/gnucash-htdocs.mo
####################################################################
#
# Code to build the Namazu templates
#
LOCALFILE=local.php
URLBASE=
FILETAIL=
LOCALE=
FILE=
HOME=https://www.gnucash.org$(URLBASE)
TMPLBASE=search/templates/NMZ.
# add when we have utf-8 translations: iconv -f UTF-8 -t ISO8859-1
nmz.onefile:
( echo '<?php $$locale = "$(LOCALE)"; ?>' ; \
cat $(TMPLBASE)$(FILE).php_tmpl ) | php -q > \
$(TMPLBASE)$(FILE)$(FILETAIL)
nmz.lang:
for f in head body foot result.normal result.short tips ; do \
$(MAKE) nmz.onefile FILE="$$f"; \
done
nmz.locale:
# convert to ISO_8859-1
for f in $(TMPLBASE)*.$(LOCALE); do \
iconv -f utf-8 -t ISO_8859-1//TRANSLIT -o $$f.local -c $$f ; \
mv $$f.local $$f ; \
done
nmz:
$(MAKE) nmz.lang
# note: PL is only "mostly" translated. it diff's differently
for l in en ${languages} ; do \
$(MAKE) nmz.lang FILETAIL=.$$l LOCALE=$$l; \
done
for l in ${iso_languages} ; do \
$(MAKE) nmz.locale LOCALE=$$l; \
done