Revision 945f4815
Ajout support de l'i18n
Change-Id: Ia013cc72ffd1f93a9eecc2b94609284d58cc8e12
.gitignore | ||
---|---|---|
33 | 33 |
!/src/plugins/ |
34 | 34 |
/src/plugins/* |
35 | 35 |
!/src/plugins/vigilo |
36 |
/src/plugins/vigilo/locales/*.mo |
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 |
src/plugins/vigilo/front/menu.php | ||
---|---|---|
9 | 9 |
Session::checkRight("config", UPDATE); |
10 | 10 |
|
11 | 11 |
Html::header( |
12 |
__('Vigilo', 'vigilo'),
|
|
12 |
'Vigilo',
|
|
13 | 13 |
$_SERVER["PHP_SELF"], |
14 | 14 |
"plugins", |
15 | 15 |
"PluginVigiloMenu", |
src/plugins/vigilo/inc/menu.class.php | ||
---|---|---|
122 | 122 |
$DB->query($query); |
123 | 123 |
} |
124 | 124 |
} elseif ($needs_deploy) { |
125 |
echo "Cliquez sur « Déployer la configuration » pour appliquer les modifications en attente.";
|
|
125 |
echo __('Click on "Deploy the configuration" to apply changes.', "vigilo");
|
|
126 | 126 |
} else { |
127 |
echo "La configuration est à jour.";
|
|
127 |
echo __("The configuration is already up-to-date.", "vigilo");
|
|
128 | 128 |
} |
129 | 129 |
|
130 | 130 |
$force = empty($_POST['force']) ? '' : 'checked'; |
131 | 131 |
$debug = empty($_POST['debug']) ? '' : 'checked'; |
132 |
$debug_title = htmlspecialchars(__("Display debug and progress information for Vigilo", "vigilo"), ENT_XML1 | ENT_QUOTES, "utf-8"); |
|
133 |
$debug_label = htmlspecialchars(__("Display debug information", "vigilo"), ENT_XML1 | ENT_QUOTES, "utf-8"); |
|
134 |
$force_title = htmlspecialchars(__("Force a full deployment rather than an incremental one", "vigilo"), ENT_XML1 | ENT_QUOTES, "utf-8"); |
|
135 |
$force_label = htmlspecialchars(__("Regenerate all files", "vigilo"), ENT_XML1 | ENT_QUOTES, "utf-8"); |
|
136 |
$deploy_title = htmlspecialchars(__("Deploy the configuration", "vigilo"), ENT_XML1 | ENT_QUOTES, "utf-8"); |
|
132 | 137 |
echo <<<HTML |
133 | 138 |
</textarea> |
134 | 139 |
|
135 |
<button type="submit" name="deploy" value="1">Déployer la configuration</button>
|
|
140 |
<button type="submit" name="deploy" value="1">$deploy_title</button>
|
|
136 | 141 |
|
137 |
<label for="debug"><input name="debug" id="debug" value="1" type="checkbox" $debug |
|
138 |
title="Affiche les informations de diagnostic et de progression de Vigilo" |
|
139 |
/> Afficher les informations de débogage</label> |
|
142 |
<label for="debug"><input name="debug" id="debug" value="1" type="checkbox" $debug title="$debug_title"/> $debug_label</label> |
|
140 | 143 |
|
141 |
<label for="force"><input name="force" id="force" value="1" type="checkbox" $force |
|
142 |
title="Force un déploiement complet plutôt qu'un déploiement en mode incrémental" |
|
143 |
/> Regénérer tous les fichiers</label> |
|
144 |
<label for="force"><input name="force" id="force" value="1" type="checkbox" $force title="$force_title"/> $force_label</label> |
|
144 | 145 |
HTML; |
145 | 146 |
Html::closeForm(); |
146 | 147 |
} |
src/plugins/vigilo/locales/en_GB.po | ||
---|---|---|
1 |
# English translations for PACKAGE package. |
|
2 |
# This file is put in the public domain. |
|
3 |
# Automatically generated, 2017. |
|
4 |
# |
|
5 |
msgid "" |
|
6 |
msgstr "Project-Id-Version: Vigilo NMS\n" |
|
7 |
"Report-Msgid-Bugs-To: contact.vigilo@c-s.fr\n" |
|
8 |
"POT-Creation-Date: 2017-10-19 14:45+0200\n" |
|
9 |
"PO-Revision-Date: 2017-10-19 14:45+0200\n" |
|
10 |
"Last-Translator: Automatically generated\n" |
|
11 |
"Language-Team: none\n" |
|
12 |
"MIME-Version: 1.0\n" |
|
13 |
"Content-Type: text/plain; charset=UTF-8\n" |
|
14 |
"Content-Transfer-Encoding: 8bit\n" |
|
15 |
"Plural-Forms: nplurals=2; plural=(n != 1);\n" |
|
16 |
|
|
17 |
# |
|
18 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 125 |
|
19 |
msgid "Click on \"Deploy the configuration\" to apply changes." |
|
20 |
msgstr "Click on \"Deploy the configuration\" to apply changes." |
|
21 |
|
|
22 |
# |
|
23 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 136 |
|
24 |
msgid "Deploy the configuration" |
|
25 |
msgstr "Deploy the configuration" |
|
26 |
|
|
27 |
# |
|
28 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 132 |
|
29 |
msgid "Display debug and progress information for Vigilo" |
|
30 |
msgstr "Display debug and progress information for Vigilo" |
|
31 |
|
|
32 |
# |
|
33 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 133 |
|
34 |
msgid "Display debug information" |
|
35 |
msgstr "Display debug information" |
|
36 |
|
|
37 |
# |
|
38 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 134 |
|
39 |
msgid "Force a full deployment rather than an incremental one" |
|
40 |
msgstr "Force a full deployment rather than an incremental one" |
|
41 |
|
|
42 |
# |
|
43 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 135 |
|
44 |
msgid "Regenerate all files" |
|
45 |
msgstr "Regenerate all files" |
|
46 |
|
|
47 |
# |
|
48 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 127 |
|
49 |
msgid "The configuration is already up-to-date." |
|
50 |
msgstr "The configuration is already up-to-date." |
src/plugins/vigilo/locales/fr_FR.po | ||
---|---|---|
1 |
# French translations for PACKAGE package |
|
2 |
# Traductions françaises du paquet PACKAGE. |
|
3 |
# This file is put in the public domain. |
|
4 |
# Automatically generated, 2017. |
|
5 |
# |
|
6 |
msgid "" |
|
7 |
msgstr "Project-Id-Version: Vigilo NMS\n" |
|
8 |
"Report-Msgid-Bugs-To: contact.vigilo@c-s.fr\n" |
|
9 |
"POT-Creation-Date: 2017-10-19 14:45+0200\n" |
|
10 |
"PO-Revision-Date: 2017-10-19 14:34+0200\n" |
|
11 |
"Last-Translator: Automatically generated\n" |
|
12 |
"Language-Team: none\n" |
|
13 |
"MIME-Version: 1.0\n" |
|
14 |
"Content-Type: text/plain; charset=UTF-8\n" |
|
15 |
"Content-Transfer-Encoding: 8bit\n" |
|
16 |
"Plural-Forms: nplurals=2; plural=(n > 1);\n" |
|
17 |
|
|
18 |
# |
|
19 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 125 |
|
20 |
msgid "Click on \"Deploy the configuration\" to apply changes." |
|
21 |
msgstr "Cliquez sur « Déployer la configuration » pour appliquer les " |
|
22 |
"modifications." |
|
23 |
|
|
24 |
# |
|
25 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 136 |
|
26 |
msgid "Deploy the configuration" |
|
27 |
msgstr "Déployer la configuration" |
|
28 |
|
|
29 |
# |
|
30 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 132 |
|
31 |
msgid "Display debug and progress information for Vigilo" |
|
32 |
msgstr "Affiche les informations de diagnostic et de progression de Vigilo" |
|
33 |
|
|
34 |
# |
|
35 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 133 |
|
36 |
msgid "Display debug information" |
|
37 |
msgstr "Afficher les informations de débogage" |
|
38 |
|
|
39 |
# |
|
40 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 134 |
|
41 |
msgid "Force a full deployment rather than an incremental one" |
|
42 |
msgstr "Force un déploiement complet plutôt qu'un déploiement en mode " |
|
43 |
"incrémental" |
|
44 |
|
|
45 |
# |
|
46 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 135 |
|
47 |
msgid "Regenerate all files" |
|
48 |
msgstr "Regénérer tous les fichiers" |
|
49 |
|
|
50 |
# |
|
51 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 127 |
|
52 |
msgid "The configuration is already up-to-date." |
|
53 |
msgstr "La configuration est déjà à jour." |
src/plugins/vigilo/locales/glpi.pot | ||
---|---|---|
1 |
# SOME DESCRIPTIVE TITLE. |
|
2 |
# This file is put in the public domain. |
|
3 |
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
|
4 |
# |
|
5 |
#, fuzzy |
|
6 |
msgid "" |
|
7 |
msgstr "" |
|
8 |
"Project-Id-Version: Vigilo NMS\n" |
|
9 |
"Report-Msgid-Bugs-To: contact.vigilo@c-s.fr\n" |
|
10 |
"POT-Creation-Date: 2017-10-19 14:45+0200\n" |
|
11 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n" |
|
14 |
"MIME-Version: 1.0\n" |
|
15 |
"Content-Type: text/plain; charset=CHARSET\n" |
|
16 |
"Content-Transfer-Encoding: 8bit\n" |
|
17 |
# |
|
18 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 125 |
|
19 |
msgid "Click on \"Deploy the configuration\" to apply changes." |
|
20 |
msgstr "" |
|
21 |
# |
|
22 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 136 |
|
23 |
msgid "Deploy the configuration" |
|
24 |
msgstr "" |
|
25 |
# |
|
26 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 132 |
|
27 |
msgid "Display debug and progress information for Vigilo" |
|
28 |
msgstr "" |
|
29 |
# |
|
30 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 133 |
|
31 |
msgid "Display debug information" |
|
32 |
msgstr "" |
|
33 |
# |
|
34 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 134 |
|
35 |
msgid "Force a full deployment rather than an incremental one" |
|
36 |
msgstr "" |
|
37 |
# |
|
38 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 135 |
|
39 |
msgid "Regenerate all files" |
|
40 |
msgstr "" |
|
41 |
# |
|
42 |
# File: src/plugins/vigilo/inc/menu.class.php, line: 127 |
|
43 |
msgid "The configuration is already up-to-date." |
|
44 |
msgstr "" |
Also available in: Unified diff