gettext
| From: | Marco Muratori | Date: | Thu, 29 Aug 2002 06:39:35 +0000 |
| Subject: | gettext | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-114468@lists.php.net to get a copy of this message | ||
Hi
I'm using gettext to add i18n to a web site, and it seems to work fine,
but the translation is done randomly. I mean that if you reload many times
the page, sometimes it gives back the translated message and sometimes the
untranslated one.
These are the steps I followed to use gettext with php:
putenv("LANG=it");
setlocale(LC_ALL, "it");
bindtextdomain("test", ".");
textdomain("test");
print(gettext("This is a test message"));
xgettext -d test test.php
in the test.po file i have
msgid ""
"This is a test message"
msgstr ""
"Questo e un messaggio di prova"
msgfmt -vvvv -o test.mo test.po
mkdir -p it/LC_MESSAGES
mv test.mo it/LC_MESSAGES
The OS is FreeBSD 4.6 with apache 1.3.26 and php 4.2.1
Does anybody had the same problem?
Thanks, Marco