[thelist] multi-language website

Ricky Zhou ricky.zhou at gmail.com
Mon Sep 10 08:52:58 CDT 2007


On Mon, Sep 09/10/07, 2007 at 10:31:30AM -0300, Eduardo Kienetz wrote:
> On 9/10/07, Carlo Bongiovanni <carlo.bongiovanni at gmail.com> wrote:
> Basically there is a function that receives the original string, looks
> for a global language variable and returns its translation.
> E.g.: echo i18n('I am ') . $age . i18n(' years old');
I know this is just an example, but in general, you should avoid
concatenating translated strings like that, as different languages
might have different word orders/grammar.  I don't use know/use PHP, but
in Python, for example, you would have something like:
print _('I am %d years old' % age)

Hope this helps,
Ricky


More information about the thelist mailing list