Yes, its an i18n question, but please don't switch off just yet :)

I increasingly want to get my code i18n'zed but have little experience in this area - so if the stuff I'm writing below is rubbish, please let me know!

Ok, I need to think about:

1) Character classification and case conversion.
2) Collation order.
3) Date and time formats.
4) Numeric, non-monetary formatting.
5) Monetary formatting.
6) Message translation.
7) Loads of other l10n stuff such as zip codes, tel numbers etc.

Traditionally I presume the locale pragma and POSIX locale functions provided part of the required functionality, but from reading the perl docs, there are problems such as:

1) Limited to Unices.
2) Even with Unices, the available locale info varies drastically.
3) Perl locale handling is a bit clunky, and not all categories are handled by core functions (eg Monetary).
4) Granularity is at the application level - difficult to have simultaneously multi lingual applications.

So, I turn to 5.8 documentation/core 5.8 modules and CPAN for help:

5.8 documentation says use unicode and avoid mixing unicode and locales.

So, am I correct in thinking unicode only provides character set/conversion and collation support?

Therefore I decide to use Unicode exclusively - does this also mean I shouldn't be using built in collation functions (sort, cmp etc), instead using Unicode::Collate?

And if that's true, how on earth do you actually use Unicode::Collate - say, purely for example, I want to sort a list of Spanish words, what arguments should I supply to Unicode::Collate->new()?

Once charsets are out of the way, is there any framework that can provide money, number, date formatting consistently, or do I have to go with modules such as Math::Currency, Number::Format, DateTime and roll my own support?

To be honest, about the only thing I'm sure about at this moment in time is using Locale::Maketext!

Please forgive this ramble, but I've yet to find much helpful information about perl i18n. The perldocs aren't that much help, and the web resources I've found seem more theoretical than practical. Everything tended to refer to formal documents such as the Unicode stuff, which had me tearing my hair out.

Any advice (preferably useful though :) would be hugely appreciated.


In reply to How do you get consistent, comprehensive i18n handling in apps? by Anonymous Monk

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.