in reply to Re: Multilingual design
in thread Multilingual design
Cheers Ken for the great reply...as always you get the thought process moving in the right direction!
I don't see any MVC-violation; please explain more about what you meant
In the first solution I came up with, I was suggesting passing the language specific text from the script to the template.
I wouldn't implement it like that, but it shows my thought process...my $vars; if ($lang eq 'en') { $vars = { 'heading' => 'Dies ist eine Einführung', 'text' => 'Hier ist ein Beispiel für einige Inhalte', 'seemore' => 'mehr sehen...', }; } elsif ($lang eq 'au') { $vars = { 'heading' => 'G\'Day, this is an intro', 'text' => 'Hey Sport, just a little example', 'seemore' => 'want more...', }; } else { # Default to English $vars = { 'heading' => 'This is an introduction', 'text' => 'Here is an example of some content', 'seemore' => 'see more...', }; } $template->process('intro.tt', $vars);
I quickly moved on from there and went for having the template variables in their own template file and using a PROCESS directive to set the correct language. I only included the first option so you could get a glimpse of how my mind dealt with the stages of developing the idea.
I'll come back to the rest of your post in a while.
|
|---|