Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: Gettext with PHP
04-12-2006, 10:39 AM #1
- Join Date
- Apr 2006
- Thanked 0 Times in 0 Posts
Gettext with PHP
I spent the last days trying to make Gettext work on my new server. I really need your help. Eveything was ok while running on my local server (easyphp : apache) but it doesn't work anymore since I am on the new server (debian, php5).
Here is the code I use :
$language = 'en'; putenv("LANG=$language"); setlocale(LC_ALL, $language); // Set the text domain as 'messages' $domain = 'messages'; print bindtextdomain($domain, "/var/www/mysite/languages"); print "<br>"; textdomain($domain); echo _("input_description_tag");
Gettext doesn't seem to find my .mo file which is located in /var/www/mysite/languages/en/LC_MESSAGES/messages.mo
The value returned by Gettext is the orginal string ( "input_description_tag) and not its english translation. The permission of the file has been turned in 777. I have tried everything possible if you have any tips, I would the happiest one in the world !!
Thanks you everybody for helping me !!!