stephenclouse at gmail
Oct 6, 2011, 12:58 PM
On Thu, Oct 6, 2011 at 11:06 AM, André Walker <andre [at] andrewalker> wrote:
> I don't know if it helps, but I've been researching a little about
> localization recently, and I came across this article:
> In summary, it states Locale::Maketext shouldn't be used — we should be
> using Locale::TextDomain instead. I'm considering it for my current needs.
> Any thoughts?
The article is rather biased -- it points out the speck in Maketext's eye
while ignoring gettext's planks. The author of the article is so bent on
how gettext does things that he fails to recognize that at least some of
what Maketext does is actually an improvement. It reads a lot more like
"gettext is The One True Way; Maketext is different; therefore, Maketext is
gettext was very much built for translating locally-running applications,
and makes a lot of assumptions that simply aren't true in a web
environment. One thing about gettext that makes it untenable for web
applications is its reliance on POSIX setlocale() and environment variables
to set itself up, a design flaw that Locale::TextDomain tragically
reproduced to perfection, gauging from the documentation. Take a look at
these hoops PHP developers jump through to utilize gettext:
It should induce pain in any sane developer. Hint: if you are having to set
environment variables halfway through your application to configure
something, your design is beyond broken. Now, PHP has Zend_Translate to
rescue them from this horror, but almost no one will utilize it because the
above kind of cargo-cult hackery is par for the course in PHP.
Perl has already been rescued from this, hint hint.
The other thing that really irks me is that Locale::TextDomain hasn't had an
update since 2009. Open bugs on rt.cpan from 2 years ago. Not a fan of
such a crucial underlying library being abandonware. Maketext, for all its
warts, at least still appears to have a maintainer.
Plus, there are still untapped regions of the l10n universe --
gender-specific verb endings in Russian, anyone? This is a realm that
gettext doesn't even begin to address. I have some betting money on which
system will address it first.
Now, the article has some valid points about how Maketext does it wrong
(like not being able to handle a verbatim gettext PO), so let's fix
Maketext. gettext is a step backwards in the modern Perl world.
Stephen Clouse <stephenclouse [at] gmail>