Using gettext/poedit to make a PHP project translatable.
I have a working test-code from PHP and Javascript Internationalization using Gettext and Poedit (pontikis.net). When I move that working code to another machine, I suddenly don't get strings displayed translated, but also no error messages.
[SOLUTION]
The target locale was not installed on system.
Even if you provide the translation files, PHP will not switch to a locale which is not installed/configured on the system that your application is running.
In my case, PHP's setlocale() returned 'false' - indicating that I my target locale was missing.
Check if the locale is currently present and active:
Code: Select all
$ locale -a
Code: Select all
$ sudo locale-gen
Code: Select all
$ sudo dpkg-reconfigure locales
This should do the trick