The main problem is that I am trying to introduce a multilingual facility to a legacy system without having to do a complete rewrite. Adding a language field to the database sounds simple but would require a redesign of the whole system.

There are currently about 20k documents in a variety of english, french, german or italian in the database. Some of these will not be translated but most will need to be in at least english probably french and their native language.

Adding the tags would be straight forward and even may be possible to automate the update. It would also make it easy to do coverage reports and other such things.

I did mention that the code was a sample extracted out of a large system. The full system uses I18N::LangTags and I18N::AcceptLanguage to determine the best choice backing out using panic_languages if neccessary.

Thanks
UnderMine


In reply to Re^2: Extracting appropriate language text from HTML data by UnderMine
in thread Extracting appropriate language text from HTML data by UnderMine

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.