Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I also tend to use maketext, as there are utilities like poEdit to handle the language files.

As for your other questions:

  • localizing $_ relates to scoping problems of the variable $_. It doesn't have to do anything with localization.
  • I haven't seen a non-English error message from Perl so far. This is not a huge deal, as users shouldn't see Perl's messages anyway.
  • if you use locale, a number of things will be adapted to the current locale. For example, in a German locale, sprintf() will format a floating point number as 1,25 instead of 1.25. strftime (from the POSIX module) will format date and time strings correctly according to the current locale (e.g. Mi 13. Januar 2004, 17:52 instead of Wed, January 13th 2004, 5:52pm. Also, the sorting order will be affected by the locale (e.g. in sort).

Go and read perllocale, it has some more interesting information. For example, you can also find out the currency symbol of the current locale so you can print 100 or 100 instead of $100.

One last hint: Whatever approach you use, use a format that comes with tools like poEdit or is easy to understand. The better your software is and the easier it is to translate it, the more people will volunteer to translate it to another language (talking in a open source context, not business, of course).

In reply to Re: Writing localized Perl apps by crenz
in thread Writing localized Perl apps by flyingmoose

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    [Corion]: Meh. My lack of embedded Pg is showing. I can get the data for an image gallery with one SQL statement, but not with SQLite as it doesn't do window functions :-(

    How do I use this? | Other CB clients
    Other Users?
    Others romping around the Monastery: (9)
    As of 2018-03-23 17:47 GMT
    Find Nodes?
      Voting Booth?
      When I think of a mole I think of:

      Results (295 votes). Check out past polls.