Re: [PHP-I18N] Problems passing variables to gettext

[email protected] (Hans-Peter Oeri) Wed, 23 Dec 2009 12:49:30 +0100
Newsgroups php.i18n
Message-ID <[email protected]>
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