develooper Front page | perl.i18n | Postings from November 2005

Locale::Maketext::Simple and .po files

Thread Next
Sava Chankov
November 10, 2005 12:57
Locale::Maketext::Simple and .po files
Message ID:
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/'});
  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

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About