Good evening!

I've never implemented multilingual desing in Perl projects - at least as an original idea or intent of those Perl projects - but have used to JavaScript vue-i18n library (fast guide) that utilizes third mentioned way of making multilingual site. There you have a JSON file for each language with all language strings as a hash, and language switch can be done by HTTP headers or some other things (like session).

Using language in template is like:

{ somepage: { title: 'Hello, {userName}!' } } <title>{{ $t('somepage.title', { name: 'Alexander' }) }}</title> || VV <title>Hello, Alexander!</title>

At first this was a language file for frontend (written, as you can see, in Vue, or more precisely - in Quasar), but then it comes handy in Perl Mojolicous backend - I just read it as JSON to a hash, and voila: I can use these language strings to make ODF documents in current language, for example. So I vote for third way as I used it and this way can be convinient and language source can be used by another program - it's a simple JSON that converts from and to Perl data structures. Data once entered by human will remain readable and maintainable, as it's just a text file in all known format - this is what I like most in this scheme.


In reply to Re: Multilingual design by alexander_lunev
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.