So far I've been using a home-brewn Perl-in-HTML interpreter to realize multilingual webpages. For example, I'll have URLS like

http://server/de/page.html http://server/en/page.html

I then configured mod_rewrite to redirect these to the "true" file and set an environment variable LANG=de (or LANG=en). In my HTML file, I write

bla bla bla <!en>English page only <!de>Nur auf der deutschen Seite <!>This is gonna appear in both versions again again

Now, I'm looking to reimplement the system using something more standardized, feature-rich and tested (my C code realizing this interpreter is a mess...). I'm thinking of using Mason. However, I don't want to do lengthy checks like if ($ENV{LANG} eq "en" { ..... The point of the system is to have a short command so that I can freely intermix different languages, making it more easy to translate a webpage.

Would I have to modify Mason's parser to realise concise tags like <!de>, or can someone come up with a nice way to implement something like this more easily?


In reply to Multilingual Mason by crenz

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.