At 05:14 PM 5/29/01 -0500, James G Smith wrote:
>[EMAIL PROTECTED] wrote:
> >Where is this language value coming from? The widget's container. You only
>care about English? Then set it to "EN-US" and forget it.
>[snip]
> >Implementation strategies can be as simple as:
> >
> >
> >sub label {
> >
> >  my $self=shift;
> >  my $lang=shift || $self->container->language;
> >
> >  if (exists $self->{'label'}{$lang}) {
> >     return $self->{'label'}{$lang};
> >  }
> >  return $self->{'label'}{$self->container->language('default');
> >
> >}
>
>Something I've seen elsewhere is to have a master table of strings that the
>widgets can then reference.
>
>Different ways of doing this:
>    index strings by number (MicroSoft resources in executables);
>    index strings by the string in a particular language (TWIG with 
> English as
>the indexing language).

The latter is what Java does by default with resource files associated with 
servlets.

>This allows for sharing of strings across widgets and memory savings, 
>always a
>good thing in mod_perl.  It also doesn't slow the system down much if any
>compared to storing the strings in each widget with duplication.

Hmmm, I don't know about memory savings. But the feature you've outlined 
here could be taken advantage of by widgets but I don't think it should be 
part of the widget library. I think it's better as a separate CPAN module 
for dealing with I18N in general and maybe it already exists...


Reply via email to