gettext
| From: | Gerard Samuel | Date: | Sat, 04 May 2002 16:42:06 +0000 |
| Subject: | gettext | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-96063@lists.php.net to get a copy of this message | ||
Hi all. Im trying to get gettext working. It is compiled in php 4.1.2 on a FreeBSD-4.5 p4 box.
In the root of the webserver I have
-----------------------------------------
<?php
// User language here
putenv("LANG=fr");
putenv ("LC_ALL=fr");
// Specify location of translation tables
bindtextdomain ("messages", "./locale");
// Choose domain
textdomain ("messages");
print(_("Hello world"));
?>
---------------------------------------------
Directly under the root I have a directory structure as
--------------------------------------------
locale/en/LC_MESSAGES
locale/fr/LC_MESSAGES
Under locale/fr/LC_MESSAGES, I have messages.po messages.mo created from xgettext and msgfmt with 'Hello World' and the translation 'Bonjour Monde' in messages.po.
For some reason or another, it won't translate to french. Anyone see anything wrong with this setup??
Thanks