perl-i18n

Re: Locale::Maketext::Simple and .po files

2005-11-10 16:03:43
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sava Chankov wrote:

| 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.

If you want to avoid having translators to deal with many small po
files, create one large po file containing all strings, and then many
small ones for the original components.  When the translated po files
arrive from your translators, you can msgmerge (see "msgmerge --help")
that large file as kind of a compendium with the individual small ones.

For your other problem, have a look at Locale::gettext::textdomain() or
Locale::TextDomain.  See Crypt::Twofish_PP or Test::Unit::GTestRunner
for examples how you can localize components with it.

Regards,
Guido
- --
Imperia AG, Development
Leyboldstr. 10 - D-50354 Hürth - http://www.imperia.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFDc9GrOo0HNPWNDz0RAibAAJ9HpdZVQazJK8YyccdavTvJQvv6AgCgibT2
XxJ+/J7LkgDgycUGYQa5DjY=
=KjZH
-----END PGP SIGNATURE-----

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