1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hotspot_ynh.git synced 2024-09-03 19:25:53 +02:00
hotspot_ynh/sources/i18n/README.md

46 lines
1.3 KiB
Markdown
Raw Normal View History

2015-07-08 18:36:14 +02:00
## 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
```
2015-07-08 18:38:18 +02:00
English is the default language when the browser language is not available.
2015-07-08 18:36:14 +02:00
## Update the default string list
Updating the pot file from template files:
```
2015-07-25 00:39:12 +02:00
xgettext sources/*.php sources/views/*.php -o sources/i18n/localization.pot
2015-07-08 18:36:14 +02:00
```
## 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:
```
2015-07-08 19:03:28 +02:00
msginit --locale=fr_FR.UTF-8 --no-translator -i sources/i18n/localization.pot -o sources/i18n/fr_FR/LC_MESSAGES/localization.po
2015-07-08 18:36:14 +02:00
```
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*.