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
gettext not working under remote server
Moderator: General Moderators
-
thosecars82
- Forum Commoner
- Posts: 94
- Joined: Thu Apr 03, 2008 6:31 am
- Location: Arganda, Madrid
- Contact:
- phdatabase
- Forum Commoner
- Posts: 83
- Joined: Fri May 28, 2010 10:02 am
- Location: Fort Myers, FL
Re: gettext not working under remote server
Have you checked the manual http://us.php.net/manual/en/book.gettext.php ? Seems to be a lot of platform exceptions.
-
thosecars82
- Forum Commoner
- Posts: 94
- Joined: Thu Apr 03, 2008 6:31 am
- Location: Arganda, Madrid
- Contact:
Re: gettext not working under remote server
It is solved now.
Sorry,
I eventually noticed that the $locale variable had not been properly set.
Thanks
Sorry,
I eventually noticed that the $locale variable had not been properly set.
Thanks