[sf-perl] Internationalizing a Perl application

Quinn Weaver qw at sf.pm.org
Mon Jan 15 15:06:51 PST 2007


On Mon, Jan 15, 2007 at 12:54:05PM -0800, Matthew Lanier wrote:
> 
> [ posted to sfpug only, i certainly can't post on the other pugs ]
> 
> David-
> 
> first, congrats on needing to internationalize DBI-Link.  that's a good 
> sign.
> 
> As for the docs, have you run them through babbelfish or something of that 
> ilk?  if the results are sufficient, I question the need to translate them 
> now, and to continue translating future revisions, as you could instruct 
> folks to babbelfish it themselves.

Bad idea.  Babelfish can barely handle the most basic English, and
technical writing will foul it up beyond belief.  Babelfish is so
bad that laughing at its incomprehensible translations has become
a party game. :)

> As for the strings (are you talking about error codes and such), can you 
> make them constants and map the constants to descriptive error strings in 
> the docs?

Good idea.  For error codes, there should be a localized human-readable
explanation, but there should also be an invariant code.  That way
client code (if there's any kind of API or log) will work no matter what
the locale.

If you're writing a log, you should begin messages with a number
(the constant Matt mentions).

If people are writing client code against your API, it's a must to die
with object-oriented exceptions, rather than strings.  Perl Best
Practices explains how to do this; see p. 287, OO Exceptions (in
Chapter 13, Error Handling).

I'm not sure exactly how this applies to DBI-Link--would people
write "client" code against it?--but David can figure out that part.

As to the rest... I have prepared a lengthy email with a bunch of
advice, ubt I'm waiting to get subscribed to all the CC'ed lists so I
can send it out all at once.  Hold in there...

Best regards,

--
qw (Quinn Weaver); #President, San Francisco Perl Mongers
=for information, visit http://sf.pm.org/weblog =cut


More information about the SanFrancisco-pm mailing list