Re: Problems passing variables to gettext

From: Date: Wed, 23 Dec 2009 11:49:30 +0000
Subject: Re: Problems passing variables to gettext
References: 1 2 3  Groups: php.i18n 
Request: Send a blank email to php-i18n+get-1344@lists.php.net to get a copy of this message
Hi! Lumiere de Lune wrote: > $sitetitle= _('My beautiful site') ; in variables.php > And echo $sitetitle in the second file, which is my template. > > As it did not work, I imagined the translation of the variable did not work You mean the translation of the constant expression, whose result gets assigned to a variable? There is no reason why the translation should fail because of a (later) assignment of its result. > But the other strings are in other files, so this is the only case where I > define a variable that has to be translated. Other files? Are you sure locale setting/domain/path are set for *this* file, too? Might $sitetitle be re-set after the translation assignment? If not: Would it be possible to boil down a test case? HPO

« previous php.i18n (#1344) next »