I would like to localize my php website using mo files but I have encountered some problems using gettext.
This is the example I've used:
<?php
putenv('LC_ALL=de_DE');
setlocale(LC_ALL, 'de_DE');
bindtextdomain("myPHPApp", "./locale");
textdomain("myPHPApp");
echo _("Have a nice day");
?>
My problem is that locales installed on my server is only en_GB.utf8, so
setlocale(LC_ALL, 'de_DE');
Always returns FALSE.
I found a workaround using the library "php-gettext" (https://launchpad.net/php-gettext/) that simulates the real php gettext functions and seems to works fine also if needed locales are not present on the system.
Anyone has experience with this library? It works fine? Is this the only solution if I can't add locales to my web server but I want to use mo files?
Thanks!