doc/developer/LanguageTranslation

Howto update an existing translation

This example is for the french translation. For another language, just replace "fr" with the appropriate language code in the following instructions.

Updating the .po

  1. Retrieve the .po file from svn at the following URL (replace "fr" with the appropriate language code):  https://dev.wifidog.org/svn/trunk/wifidog-auth/wifidog/locale/fr/LC_MESSAGES/messages.po
  2. Update the .po file you downloaded: You can translate/correct just a few sentence, or the entire file. There are several good graphical .po editors, the two best known being  KBabel and  poEdit.
  3. Send us the updated file. The usual way is to attach the file to a new ticket on wifidog's trac.

For most people you are done.

Checking out the result in wifidog

  1. Run wifidog-auth/wifidog/locale/compile.sh
  2. Restart Apache. You will have to do this when you recompile, because .mo binary files are cached by gettext.
  3. See your updated translation in action

Comiting a contributed translation (for those with commit access)

  1. Put the updated file in your local tree
  2. Run wifidog-auth/wifidog/locale/gen.sh
  3. Run wifidog-auth/wifidog/locale/compile.sh
  4. Update the ChangeLog
  5. svn commit

Howto add a brand new translation

  1. Using a shell, go to /path_to/wifidog/locale directory.
  2. Create a new directory for your new language ( ex: "ru" for Russian, "jp" for japanese, etc ). The Russian language will be use as example.
  3. Create the same folder hierarchy as in "fr" ( ./ru/LC_MESSAGES )
  4. Execute the shell script gen.sh, this will grab new strings in ./ru/LC_MESSAGES/messages.po. If you received errors like "PHP is not supported", make sure you have the latest version of Gettext and you're using the xgettext version provided with PHP5. If xgettext is not in your PATH, try locate xgettext to find it.
  5. Edit message.po. If you're under Linux use  KBabel for translation, otherwise make sure your text editor writes UTF-8 (  xemacs manages .po pretty well )
  6. Once completed, run the script compile.sh, this will create a ./ru/LC_MESSAGES/messages.mo binary file
  7. Add "ru" locale to config_available_locales.php
  8. Restart Apache. You will have to do this when you recompile, because .mo binary files are cached by gettext.
  9. You should now be able to select your language !
  10. Finally, send us your translation file (message.po) by attaching it to a tichet. Please include the name of your language (in you local language as well as in english). We will add your translation to the repository.