Hi Sergei,

On Fri, Jul 18, 2008 at 02:06:25PM +0400, Sergei Vyshenski wrote:
> > I'll have to try that out, but I doubt it would make any real impact -
> > have you experienced one?
> 
> No, but not much testing.

Well, what the author says looks promising. I haven't gotten it to work
properly, though, here is what I tried:

diff --git a/trunk/perl-modules/core/trunk/OpenXPKI/i18n.pm 
b/trunk/perl-modules/core/trunk/OpenXPKI/i18n.pm
index 48daf89..500951c 100644
--- a/trunk/perl-modules/core/trunk/OpenXPKI/i18n.pm
+++ b/trunk/perl-modules/core/trunk/OpenXPKI/i18n.pm
@@ -16,6 +16,7 @@ use OpenXPKI::Debug;
 use Locale::Messages qw (:locale_h :libintl_h nl_putenv 
bind_textdomain_filter);
 use POSIX qw (setlocale);
 use Encode;
+use Locale::gettext_pp;
 
 our $language = "";
 our $locale_prefix = "";
@@ -61,7 +62,7 @@ sub i18nGettext {
     ## we need this for utf8
     #it's too slow, I try to use "use utf8;"
     #my $i18n_string = pack "U0C*", unpack "C*", gettext ($text);
-    my $i18n_string = gettext ($text);
+    my $i18n_string = Locale::gettext_pp::gettext($text);
 
     if ($i18n_string ne $text)
     {

... but this leads to I18N_... strings only being returned - am I making
a mistake or is this another bug?

If I try the following:


diff --git a/trunk/perl-modules/core/trunk/OpenXPKI/i18n.pm 
b/trunk/perl-modules/core/trunk/OpenXPKI/i18n.pm
index 48daf89..cf37e68 100644
--- a/trunk/perl-modules/core/trunk/OpenXPKI/i18n.pm
+++ b/trunk/perl-modules/core/trunk/OpenXPKI/i18n.pm
@@ -61,6 +61,7 @@ sub i18nGettext {
     ## we need this for utf8
     #it's too slow, I try to use "use utf8;"
     #my $i18n_string = pack "U0C*", unpack "C*", gettext ($text);
+    Locale::Messages->select_package('gettext_pp');
     my $i18n_string = gettext ($text);
 
     if ($i18n_string ne $text)

I get different results per Apache handler, so if I reload sometimes
I get the correct result (russian/german if language is set accordingly)
and sometimes I only get I18N_... identifiers :-(

> > Yes, it does ... Have you filed those bugs in the RT tracker against
> > the module? Maybe nobody except for us noticed them yet ;-)
> 
> I have just got an interesting answers from the author. See page:
> 
> http://rt.cpan.org/Public/Dist/Display.html?Status=Active&Name=libintl-perl

Thanks, I'll chime in there with a link to our bug and the
TestModPerlHandler I wrote earlier, which is pretty useful in showing
that the bug is neither in gettext (command line works) nor in Mason
(this is a pure mod_perl2 handler, no Mason involved).

Cheers,
  Alex
-- 
Dipl.-Math. Alexander Klink | IT-Security Engineer
        [EMAIL PROTECTED] | working @ urn:oid:1.3.6.1.4.1.11417

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
OpenXPKI-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openxpki-devel

Reply via email to