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

Locale::Maketext::Simple and .po files

Thread Next
From:
Sava Chankov
Date:
November 10, 2005 12:57
Subject:
Locale::Maketext::Simple and .po files
Message ID:
20051110184906.20944.qmail@lists.develooper.com
 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

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About