Welcome to WebmasterWorld Guest from 107.20.34.173

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

gettext works in local server but it does not work in remote server

     

thosecars82

12:17 pm on Jun 3, 2010 (gmt 0)

5+ Year Member



Hello
I have a problem.
I use gettext in a website and it seems to work fine under a local xampp installation with PHP 5.3.1
on Windows. However, when I upload the website to a server, it seems as if gettext was not working because I do not see the corresponding translations. The server has PHP 5.2.10 and Apache ver. 2.2.13 (Unix). I have made sure though, that gettext is enabled by looking at phpinfo in the server.

This is part of the code:

putenv("LC_ALL=$locale");
setlocale(LC_ALL, $locale);
bindtextdomain("messages", dirname(__FILE__) . "/locale");
textdomain("messages");

It seems to me this code is fine, but I still think the problem might be related with the path. I do not know how to debug this to verify the path used by bindtextdomain. Does bindtextdomain throw any kind of exception that I can catch with php in case bindtextdomain does not find the path given as dirname(__FILE__) . "/locale"?

Any other suggestion?
Thanks

thosecars82

12:46 pm on Jun 3, 2010 (gmt 0)

5+ Year Member



Solved. The $locale was not being set properly.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month