YunoHost-Apps / hotspot_ynh

Wifi Hotspot app for YunoHost
GNU Affero General Public License v3.0
40 stars 19 forks source link

Fix gettext (translation of the web admin) #7

Closed jvaubourg closed 9 years ago

jvaubourg commented 9 years ago

The web admin is fully compliant with gettext and a po file can be generated, with all of the strings to translate. But, there is a bug and we cannot use translation files. The PHP code in config.php must probably be fixed.

jvaubourg commented 9 years ago

I installed a new Cube with the latest version of hotspot_ynh. I configured my browser to have "fr" as first choice for the displaying language. Unfortunately, the web admin is still in English.

The computed variables in "config.php" are:

$lang: fr_FR.utf8
$locales_dir: /var/www/wifiadmin/i18n
$textdomain: localization

The package "php-gettext" is installed. Maybe another package is missing? There is no error in the logs...

Conaclos commented 9 years ago

Hi!

I've just tested and it is running... Have you generated the .mo file? such as explained in the i18n/README.

mkdir i18n/fr_FR/LC_MESSAGES
msgfmt i18n/fr_FR/localization.po -o i18n/fr_FR/LC_MESSAGES/localization.mo
jvaubourg commented 9 years ago

I didn't generated the .mo file. But this file should be generated by default and added to the git. When someone installs the app, we cannot ask him to generate files by hand. Thanks.

Conaclos commented 9 years ago

I didn't commit the .mo file since it is a binary file... However you are right, it is not convenient for an easy installation.

jvaubourg commented 9 years ago

Bitmap images are also binary files ;). YunoHost directly uses GitHub addresses for installing apps, so we need the .mo files.

jvaubourg commented 9 years ago

Perfect. I just updated the README file. Many thanks!