On Tue, 14 Nov 2000, Kirrily Skud Robert wrote:
> STEP 3: ACTUALLY USING IT
>
> Locale::Maketext's actually functionailty can be called as follows:
>
> my $localised_string = $language->maketext($string);
Can we overload the print method of cgi.pm, so that we don't need to
change most of the existing code (modulo your comments below about h1(..)
etc)?
> Of course, undef isn't very useful, so instead of using the simple code
> above, I'd suggest something like:
>
> sub localise {
> my $string = shift;
> if (my $localised_string = $language->maketext($string)) {
> return $localised_string;
> } else {
> warn "L10N warning: can't localise '$string'";
> return $string;
> }
> }
>
> This means it'll default back to the base language if it can't find a
> translation.
Much better. We could even be really adventurous and and have the warnings
routed by email to "[EMAIL PROTECTED]" so that there'd
be a steady stream of "requiring translation" strings going to the
translation teams. :-)
> Problem 1: finding every single string
>
> Not all strings are output using the print() function. For instance,
> some are output using $cgi->h1("heading goes here") or through other
> specialised code.
We might be able to enumerate those cases.
I remember seeing a tool from another project for finding strings needed
to a lexicon. I'll see if I can dig it up.
> Problem 2: maintaining lexicon files
>
> This is a complete PITA. The problem is that every time you change
> even the punctuation of a string, let alone the meaning or adding new
> strings, you have to update every single lexicon file. It also means
> contacting translators for every single supported language. I don't
> yet know of a good clean way to manage this process.
See above. Whether we could keep teams of translators if we bombard them
with messages is another thing, of course. And I'm sure that we can be
selective and provide automation to assist with tracking missing
translations. The main point is that the exception handler can stick data
into a database.
Charlie Brady [EMAIL PROTECTED]
http://www.e-smith.org (development) http://www.e-smith.com (corporate)
Phone: +1 (613) 368 4376 or 564 8000 Fax: +1 (613) 564 7739
e-smith, inc. 1500-150 Metcalfe St, Ottawa, ON K2P 1P1 Canada