>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:
>setlocale(LC_ALL, "it");
>bindtextdomain("test", ".");
>print(gettext("This is a test message"));
>xgettext -d test test.php
>in the test.po file i have

Wild Guess:

>msgid ""
>"This is a test message"
>msgstr ""
>"Questo e un messaggio di prova"

Try filling in the parts that look "missing" here...

Give msgid a non-blank value like 42 or something.

And I'm guessing that "" after msgstr should maybe also have something
useful in it?

I've really got no idea what I'm talking about, but this is the only part
that looks "weird"

I would also try putting a <?php phpinfo();?> on the page and see if the
trigger for the "it" is consistently coming through.  If the fast reload on
the browser is making it not send the right request, PHP ain't never gonna
be able to guess what to do about it...
Like Music?  http://l-i-e.com/artists.htm

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to