>> It sounds like you're basically trying to implement content negotiation >> inside Mason. > > Not exactly: when it comes to web software, and not long static texts, > your components are mostly html code, and lots of tiny pieces of text, > like labels and table headers. You definitely don't want to create > several components in this case, the regular approach of some syntax for > translatables is the way to go. > > However, the point when the translation happens is usually the very last > step now: when the component runs. I think it would be a lot nicer, and > maybe somewhat faster if the translation would happen when mason compiles > the page, and keeps separate copes of the compiled versions by language. > >> I think the approach I'd use, would be to have several components, in >> different languages, and then get the dispatcher to dispatch to the >> correct component (with a default fallback). This strikes me as being > > An other issue: you can't let the user change languages from your > interface in this case, the user should depend on his browser to send > the right locale code. Personally I don't like it, since the browsers > always screw me. So having apache to choose is too early I think.
The fast and simple solution I found, was having a component which set a global variable called $Lang. And then inside the components or pages or whatever I define the sections that should appear on the different languages as: % if ($Lang eq 'ES') { ... % } else { ... % } This way I don't have that much components around. And if something is not clean enough I put it in another subcomponent or component, or even module and call it from the right place... only an idea... Regards, Florian > > Best regards, > Baldvin > > ------------------------------------------------------------------------- > 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 > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > > -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ------------------------------------------------------------------------- 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