[jifty-devel] [bug] Jifty's I18N support

Agent Zhang agentzh at gmail.com
Fri Jan 26 11:37:02 EST 2007

On 1/26/07, Ishigaki Kenichi <ishigaki at tcool.org> wrote:
> Hi, Agent.
> I saw t/TestApp/t/i18n-standalone.t and wondered: was it really
> possible to internationalize texts just by changing Accept-Language
> header?

Yes, of course. Please take a look at the following paragraph quoted
from Locale::Maketext's POD, upon which Jifty::I18N is currently

    When get_handle is called with an empty parameter list, magic happens:
    If get_handle senses that it's running in program that was invoked
as a CGI, then it tries to get language-tags out of the environment
variable ``HTTP_ACCEPT_LANGUAGE'', and it pretends that those were the
languages passed as parameters to get_handle.

Once we have L10N.Lang set in config.yml, Jifty::I18N will feed that
list to get_handle instead of an empty list, and we won't get the
"magic" part mentioned above. Our app's interface language is thus
"fixed", regardless of the browser user's actual locale settings. For
this reason, it is actually the server's L10N, instead of the end
user's L10N.

> I remember sometime last year (maybe July, when I was writing some
> Jifty introduction for a magazine) L10N: PoDir's behavior was
> somewhat changed, and I rewrote its value for my sample application.
> So, make sure first you have installed Jifty properly, especially if
> you're trying Jifty on Win32 (just "svn co ..." is not enough if you
> have once installed Jifty with ppm. Do "nmake/dmake install" to update
> your site lib).  And then, set Lang and PoDir explicitly in your app's
> etc/config.yml like:
> framework:
>   L10N:
>     Lang: zh-tw
>     PoDir: share/po

Yeah, that's exactly what I've been doing here. But I want real "I18N"
on Win32. :)

> At least just with these, I can see zh-tw-ized Jifty on my Win32 box,
> with no code changes.

*Nod* This is already working on Windows, but not quite enough, I think.

> I think the above i18n test is for something quite different. It sure
> has some merit of its own, though.

GREAT merit. :)


More information about the jifty-devel mailing list