[Israel.pm] Multilingual Web Sites with Perl?
gaal at forum2.org
Sun Mar 28 08:12:03 PST 2004
On Sun, Mar 28, 2004 at 03:12:12PM +0200, Yuval Yaari wrote:
> >I did work with it, yes, with Mason.
> Is maintenance easy?
> i.e: does adding pages/phrases take a lot of time and/or frustrating?
The point of using the Lexicon extension to Maketext is the ease of
use: I use the provided xgettext to extract my strings and maintain
them as I would any PO file.
> Did you use something like (shamelessly stolen from the page you gave me):
> <&|/l, $args...&>Single line of text</&> ?
> I might end up messing with Mason's internals and add <&[funny
> character]>text</&[funny character]> to implement it :)
Funny you should mention that, because I extended Mason's parser
to have lines beginning with %& interpreted as translatable :)
But then I decided it wasn't really worth the uglification, so
I never used it.
> Anyway, how does that differ from just setting up a hash table? Encoding
> shouldn't be such a huge issue...
> Any other tips/tricks/gotchas/comments would be appreciated.
The lexicon is not in your code. You can give it to other people
to translate, add languages, etc.
You have nicer toolchain support (xgettext) to extract new and modified
translatable strings from the pages.
And a gotcha: use "__()", not "_()" as you would in a c program, to
mark strings as translatable in code. _ is automatically ::_ in Perl,
a fact that took me a while to realize and caused me some coffee jitter
late at night.
Gaal Yahas <gaal at forum2.org>
More information about the Perl