Re: gettext

From: Date: Sat, 31 Aug 2002 01:13:02 +0000
Subject: Re: gettext
Groups: php.general 
Request: Send a blank email to php-general+get-114739@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 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

« previous php.general (#114739) next »