perl-i18n

How to organize lexicons with Locale::Maketext and oo-development ?

2002-08-30 05:07:27
Hello.

I'm trying to i18n a object-oriented component set with Locale::Maketext, and 
i'm looking for the best way to organise my lexicons accordingly. 

Let's take this class hierarchy as exemple (i fear however how proportional 
fonts will render it :-)
              A
       /            \
     A1           A2
   /     \         /    \
A1.1 A1.2  A2.1 A2.2 

If i get the language handle in A constructor, it will be automatically shared 
by all its descendants, but i'll have to use a unique lexicon class (per 
language, of course) for the whole hierachy, wich is not very practical.

However, if i have each class get its own handle in its own constructor, i can 
use one lexicon class (still per language) for each of my class, provided 
each of the also inherits ancestor's lexicon class.

So, i can either use:
A call A::L10N->get_handle(),
A1 use A's handle,
A2 use A's handle,
etc...

or
A call A::L10N->get_handle(),
A1 call A1::L10N->get_handle() with A1::L10N extending A::L10N,
A2 call A2::L10N->get_handle() with A2::L10N extending A::L10N,
etc...

Am i correct in my assumptions ?
-- 
Guillaume Rousse <rousse(_at_)ccr(_dot_)jussieu(_dot_)fr>
GPG key http://lis.snv.jussieu.fr/~rousse/gpgkey.html

<Prev in Thread] Current Thread [Next in Thread>