While mainly an issue in web application frameworks, the need to have text strings generated in a mulitplicity of languages, be they natural or otherwise, can often crop up.

The one way to know you aren't handling the job right is when you are using a bunch of if-thens in a large number of isolated places.

One right way for databases, which I have discussed at length, is DBIx::Recordset. One right way for language would be Locale::Maketext or within web application frameworks, Apache::Pagekit and the Ralf Engelschall's Web Metalanguage have good support for this.

However, two CPAN modules which don't seem to get a lot of attention but go a long way toward solving both of these problems in a very agnostic way are Phrasebook (for natural language) and Phrasebook::SQL for database query languages.

Since this is just a meditation, I can slip out the door having said just this much. I would love to provide a review of these at some point in the future, showing how they can add these features to web application frameworks that currently lack them.


In reply to Phrasebooks - Natural and Database Language Demultiplexers by princepawn

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.