On Tuesday 09 January 2007 14:41, Oliver Jeeves wrote:
> > % if ($Lang eq 'ES') {
> > ...
> > % } else {
> > ...
> > % }
>
> Using if() {} else {} is an ugly, ugly solution. Especially if you're
> going to have multiple languages, or want the ability to add new
> languages later. It's also much more prone to errors - missed closing
> braces etc. - then other methods.

besides the fact that most i18n/l10n tools enable you to have fallback modes, 
like 'fr_CA' (Canadian french) falls back to 'fr' if not provided. that makes 
the if/else solution unworkable too.

The idea about letting the Mason parser produce separate files based on 
language may seem nice, but I wonder if the gain in computation is really 
that substantial. Especially when there are queries to remote DBs, reading 
sessions, multiple components, etc. making the translation overhead a small 
part of the total cost, my gut feeling is that this is better handled with 
things like caching (Mason component caching) or network/browser caching 
(with all its pitfalls).

Has anybody measured this once ? I guess not :-)

>
> Baldvins quite right in that my earlier solution wasn't particularly good;
> you don't want to duplicate any work changing layout for each language you
> have.

--paf
-- 
--paf

-------------------------------------------------------------------------
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