[thelist] multi-language website

Eduardo Kienetz eduardok at gmail.com
Mon Sep 10 09:50:30 CDT 2007

On 9/10/07, Ricky Zhou <ricky.zhou at gmail.com> wrote:
> 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.

Agreed, but it usually works pretty good if you don't have something
like gettext.

> I don't use know/use PHP, but
> in Python, for example, you would have something like:
> print _('I am %d years old' % age)

That's gettext, the best option (probably most used).
Probably all widespreaded programming languages support gettext.

Eduardo Bacchi Kienetz
LPI Certified - Level 2

More information about the thelist mailing list