On 7/21/06, Jeremy Blain <[EMAIL PROTECTED]> wrote:
> I'm hoping to use multiple component roots (combined with gettext or
> similar) for a multi-lingual site.
> Something like:
>
> /website/main
> /website/en
> /website/fr
> /website/es
>
> All the languages would have 2 comp roots,
> [ [ en => '/website/en' ],
>   [ main => '/website/main' ] ]
>
> Would I be better to have a separate apache handler object
> for each language, or use dynamic_comp_root or something
> similar?  I should have all the info I need to determine the language
> in the handler sub so maintaining separate handler objects is an option.
>
> What are the benefits/disadvantages?
>
> Is there anything I should watch out not to be bitten by in this?
>

In our multilingual application we just use one component root, and
all text is passed to a method which handles the translations. This
way you don't have to replicate HTML markup across multiple files.

So:

<h2><% $ism->loc('Contact us') %></h2>

Where $ism is a global Singleton created by the handler and loc is a
method which use Locale::Maketext to do the translation.

It's very easy to extract the text from your mason components using
xgettext.pl which comes with Locale::Maketext

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to