perl-i18n

Locale::Maketext::Simple and .po files

2005-11-10 13:57:43
 Hello,
I'm trying to localise some modules written by me. They're grouped in different 
directories and each directory represents a component. These components are 
utilizing a home brew framework for web development and I want to keep them as 
seamless as possible. I have wrapped all strings in gettext() calls (so as all 
the .po tools) and gettext() is defined as a method in one of the framework 
classes. 

My idea is to have one .po file per component (think components as libraries) 
and to wrap Locale::Maketext::Simple in something like:

use Locale::Maketext::Simple {  Style  => 'gettext',  };
sub gettext {
  my $self = shift;
  my $component = $self->get_component();
  Locale::Maketext::Simple->import({Path => '/opt/$component/po/'});
  loc_lang($language);
  return loc(@_);
}

However, this approach doesn't seem to be supported neither by 
Locale::Maketext::Lexicon nor by Locale::Maketext::Simple. Instead, as I 
comprehended from their documentation, they use one .po file per module. 
However, from my humble experience as application translator, this is not 
convenient for the translator at all - one have to deal with many tiny files 
instead of one for the whole library.

I'm inclined to patch Locale::Maketext::Simple and/or Locale::Maketext::Lexicon 
to make it work in such cases. Do you think there is a more creative approach 
that is convenient for the translators as well?

all the best,
Sava Chankov

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