Date: 12/15/05 (PHP Community) Keywords: php, html, linux, apache I just can not get gettext() to work! I feel like every article I've read on the subject offers a different way to implement this in a script, but none of them seem to be working for me. If anyone can offer any help, it would be greatly appreciated. Server environment(s): ------------------------ public_html\gettext.php ------------------------ putenv ("LANG=es"); setlocale(LC_ALL, ""); bindtextdomain ("messages", "c:\localhost\site\internals\lang"); textdomain ("messages"); print(gettext ("Hello!")); ?> ------------------------ shell commands ------------------------ xgettext -a --omit-header gettext.php msgfmt -o messages.mo messages.po ------------------------ internals\lang\en\LC_ MESSAGES\messages.po ------------------------ #: gettext.php:27 msgid "Hello!" msgstr "!olleH" ------------------------ internals\lang\es\LC_ MESSAGES\messages.po ------------------------ #: gettext.php:27 msgid "Hello!" msgstr "Hola!" EDIT: I've miraculously and inexplicably gotten the script to work on my local box, but it still won't work on the Linux server. I think it might have something to do with the "putenv("LANG=es"). Is there a different variable that needs to be set? Ideas? Source: http://www.livejournal.com/community/php/379698.html
|