Revision 945f4815
Ajout support de l'i18n
Change-Id: Ia013cc72ffd1f93a9eecc2b94609284d58cc8e12
Makefile | ||
---|---|---|
38 | 38 |
serve: |
39 | 39 |
$(php) -S 0.0.0.0:8080 -t src |
40 | 40 |
|
41 |
.PHONY: all install install_pkg clean man doc serve |
|
41 |
# Internationalisation |
|
42 |
i18n: extract_messages identity_catalog update_catalog compile_catalog |
|
43 |
|
|
44 |
extract_messages: |
|
45 |
find src/plugins/vigilo/ -name '*.php' | \ |
|
46 |
xargs xgettext --keyword=_n:1,2,4t --keyword=__s:1,2t --keyword=__:1,2t \ |
|
47 |
--keyword=_e:1,2t --keyword=_x:1c,2,3t --keyword=_ex:1c,2,3t \ |
|
48 |
--keyword=_nx:1c,2,3,5t --keyword=_sx:1c,2,3t \ |
|
49 |
-L PHP --from-code=utf-8 \ |
|
50 |
-o src/plugins/vigilo/locales/glpi.pot\ |
|
51 |
--force-po --escape --strict --sort-output \ |
|
52 |
--add-comments=TRANSLATOR --copyright-holder=CSSI \ |
|
53 |
--package-name="Vigilo NMS" --foreign-user \ |
|
54 |
--msgid-bugs-address=contact.vigilo@c-s.fr |
|
55 |
|
|
56 |
init_catalog: extract_messages |
|
57 |
msginit --no-translator -i src/plugins/vigilo/locales/glpi.pot --locale="$(LANG).UTF-8" -o "src/plugins/vigilo/locales/$(LANG).po" |
|
58 |
|
|
59 |
update_catalog: extract_messages |
|
60 |
for po in `find src/plugins/vigilo/locales/ -name '*.po'`; do \ |
|
61 |
touch $$po; \ |
|
62 |
msgmerge -N -i -s -o "$$po" "$$po" src/plugins/vigilo/locales/glpi.pot; \ |
|
63 |
done |
|
64 |
|
|
65 |
identity_catalog: extract_messages |
|
66 |
$(MAKE) init_catalog LANG=en_GB |
|
67 |
|
|
68 |
compile_catalog: update_catalog |
|
69 |
for lang in `find src/plugins/vigilo/locales/ -name '*.po'`; do \ |
|
70 |
lang=`basename "$$lang" .po`; \ |
|
71 |
echo -n "$$lang : " && msgfmt --statistics -o "src/plugins/vigilo/locales/$$lang.mo" "src/plugins/vigilo/locales/$$lang.po"; \ |
|
72 |
done |
|
73 |
|
|
74 |
.PHONY: all install install_pkg clean man doc serve \ |
|
75 |
i18n extract_messages update_catalog identity_catalog compile_catalog |
Also available in: Unified diff