[LA.pm] [sf-perl] Internationalizing a Perl application

David Fetter david at fetter.org
Mon Jan 15 15:24:51 PST 2007


On Mon, Jan 15, 2007 at 03:06:51PM -0800, Quinn Weaver wrote:
> 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. :)

OK, I'll just use Babelfish for its entertainment value :)

> > 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.

I'm unclear as to the differences between locale and encoding, but I'm
thinking that for a given PostgreSQL database where the software is
installed, it should have sane defaults for error messages.

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

OK, I'll see what I can do about this.  I suspect SQL error codes may
play a part.

> 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.

Depends what you mean by "client" code.  DBI-Link is a little like
DBI, except that I can't really picture what "subclassing" it would
mean.  Generally, people use SQL with DBI-Link, and it's usually so
transparent that they may not even know it's installed.

> 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...

Thanks :)

(Cheers|Santé|Salud|ПростЬ),
D
-- 
David Fetter <david at fetter.org> http://fetter.org/
phone: +1 415 235 3778        AIM: dfetter666
                              Skype: davidfetter

Remember to vote!


More information about the Losangeles-pm mailing list