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.

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 wouldn't implement it like that, but it shows my thought process...

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.


In reply to Re^2: Multilingual design by Bod
in thread Multilingual design by Bod

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.