diff --git a/sources/i18n/README b/sources/i18n/README deleted file mode 100644 index 8bd2e4b..0000000 --- a/sources/i18n/README +++ /dev/null @@ -1,23 +0,0 @@ -Add a "localization.pot" to this directory, and one folder per translated language, containing the po a LC_MESSAGE directory (with the .mo) - -See: https://github.com/YunoHost/admin_v1/tree/master/i18n - -## Example - -The next command generates the pot file from templates files -``` -xgettext views/* -o i18n/localization.pot -``` - -The template must use directly the function ```gettext``` or its alias ```_```. - -The following command generate the .po file for the language fr_FR with UTF-8 as enconding: -``` -msginit --locale=fr_FR.UTF-8 -i i18n/localization.pot -o i18n/fr_FR/localization.po -``` - -Once the po file fullfilled, you can generate the .mo file used by the system. -``` -msgfmt i18n/fr_FR/localization.po -o i18n/fr_FR/LC_MESSAGES/localization.mo -``` - diff --git a/sources/i18n/README.md b/sources/i18n/README.md new file mode 100644 index 0000000..960df01 --- /dev/null +++ b/sources/i18n/README.md @@ -0,0 +1,45 @@ +## Force language + +The default language of the web admin depends on your browser language. + +You can force a language by using (e.g. for French): +``` +/wifiadmin/?/lang/fr +``` + +English is the default language if the browser language is not available. + +## Update the default string list + +Updating the pot file from template files: +``` +xgettext sources/views/* -o sources/i18n/localization.pot +``` + +## Add a new language + +Create a new directory path (e.g. for French): +``` +mkdir -p sources/i18n/fr_FR/LC_MESSAGES/ +``` + +Generate the po file: +``` +msginit --locale=fr_FR.UTF-8 -i sources/i18n/localization.pot -o sources/i18n/fr_FR/LC_MESSAGES/localization.po +``` + +You can use poedit for translating the po: +``` +poedit sources/i18n/fr_FR/LC_MESSAGES/localization.po +``` + +With poedit, just save your modifications with the button and the *localization.mo* (compiled version of the po) file will automatically be created or updated. + +If you edited the po by hand, you have to compile the mo file: +``` +msgfmt sources/i18n/fr_FR/localization.po -o sources/i18n/fr_FR/LC_MESSAGES/localization.mo +``` + +Change the default language of your browser, and test this new translation. + +You should add the locale to the list at the end of *sources/controller.php*. diff --git a/sources/i18n/fr_FR/LC_MESSAGES/localization.mo b/sources/i18n/fr_FR/LC_MESSAGES/localization.mo index 75fc8a2..59e832d 100644 Binary files a/sources/i18n/fr_FR/LC_MESSAGES/localization.mo and b/sources/i18n/fr_FR/LC_MESSAGES/localization.mo differ diff --git a/sources/i18n/fr_FR/localization.po b/sources/i18n/fr_FR/LC_MESSAGES/localization.po similarity index 83% rename from sources/i18n/fr_FR/localization.po rename to sources/i18n/fr_FR/LC_MESSAGES/localization.po index 87d9706..75b5423 100644 --- a/sources/i18n/fr_FR/localization.po +++ b/sources/i18n/fr_FR/LC_MESSAGES/localization.po @@ -5,10 +5,10 @@ # msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" +"Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2015-06-11 23:05+0200\n" -"PO-Revision-Date: 2015-06-14 22:37+0200\n" +"PO-Revision-Date: 2015-07-08 18:33+0100\n" "Last-Translator: root \n" "Language-Team: French\n" "Language: fr\n" @@ -16,6 +16,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 1.6.10\n" #: views/layout.html.php:27 msgid "Wifi Hotspot" @@ -41,7 +42,9 @@ msgstr "Configuration du point d'accès" #: views/settings.html.php:39 views/settings.html.php:41 msgid "" "This is a fast status. Click on More details to show the complete status." -msgstr "Ceci est un résumé du statut. Cliquez sur Plus de détails pour consulter l'intégralité du statut." +msgstr "" +"Ceci est un résumé du statut. Cliquez sur Plus de détails pour consulter " +"l'intégralité du statut." #: views/settings.html.php:39 msgid "Running" @@ -69,7 +72,7 @@ msgstr "Point d'accès activé" #: views/settings.html.php:73 msgid "Device" -msgstr "Appareil" +msgstr "Interface" #: views/settings.html.php:85 msgid "Channel" @@ -84,7 +87,10 @@ msgid "" "You are currently connected through the wifi hotspot. Please, confirm the " "reloading, wait for the wifi disconnect/reconnect and go back here to check " "that everything is okay." -msgstr "Vous êtes actuellement connecté(e) au point d'accès WiFi. Veillez confirmer le rechargement, attendre que le WiFi se déconnecte/reconnecte et revenir ici pour vérifier que tout est correct." +msgstr "" +"Vous êtes actuellement connecté(e) au point d'accès WiFi. Veillez confirmer " +"le rechargement, attendre que le WiFi se déconnecte/reconnecte et revenir " +"ici pour vérifier que tout est correct." #: views/settings.html.php:124 views/settings.html.php:130 msgid "Reloading may take a few minutes. Be patient." @@ -126,7 +132,9 @@ msgstr "Sécurisé" msgid "" "Disabling the Secure Wifi allows everyone to join the hotspot and spy the " "traffic (but it's perfect for a PirateBox)" -msgstr "Désactiver le WiFi sécurisé permet à tout individu de se connecter au point d'accès et d'espionner le trafic (Cependant c'est parfait pour une PirateBox)" +msgstr "" +"Désactiver le WiFi sécurisé permet à tout individu de se connecter au point " +"d'accès et d'espionner le trafic (Cependant c'est parfait pour une PirateBox)" #: views/_ssid.html.php:31 msgid "Password (WPA2)" @@ -144,7 +152,10 @@ msgstr "Montrez à vos amis comment accèder à votre point d'accès" msgid "" "Currently, your wifi clients don't have IPv6 and it's a very bad thing. Ask " "your Internet Service Provider an IPv6 delegated prefix, or" -msgstr "Actuellement vos clients WiFi n'utilisent pas IPv6, ce qui n'est pas une très bonne chose. Demandez à votre Fournisseur d'accès Internet un préfixe IPv6." +msgstr "" +"Actuellement vos clients WiFi n'utilisent pas IPv6, ce qui n'est pas une " +"très bonne chose. Demandez à votre Fournisseur d'accès Internet un préfixe " +"IPv6." #: views/_ssid.html.php:45 msgid "change providers"