]> sipb.mit.edu Git - ikiwiki.git/commitdiff
* Fix encoding issue with use of Locale::Gettext. Seems that the OO
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 11 Jan 2007 23:29:22 +0000 (23:29 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Thu, 11 Jan 2007 23:29:22 +0000 (23:29 +0000)
  interface returns proper utf-8 decoded strings, unlike the traditional
  interface, so use the OO interface.

IkiWiki.pm
debian/changelog

index 41276e118bafbf96064f4286562021d3c7640e60..43ef67e8c9ce6ea4824977528a602533962cd47c 100644 (file)
@@ -816,13 +816,15 @@ sub file_pruned ($$) { #{{{
        $file =~ m/$regexp/;
 } #}}}
 
+my $gettext_obj;
 sub gettext { #{{{
        # Only use gettext in the rare cases it's needed.
-       # This overrides future calls of this function.
        if (exists $ENV{LANG} || exists $ENV{LC_ALL} || exists $ENV{LC_MESSAGES}) {
-               eval q{use Locale::gettext};
-               textdomain('ikiwiki');
-               return Locale::gettext::gettext(shift);
+               if (! $gettext_obj) {
+                       eval q{use Locale::gettext ''};
+                       $gettext_obj=Locale::gettext->domain('ikiwiki');
+               }
+               return $gettext_obj->get(shift);
        }
        else {
                return shift;
index 03a352239291c5c3a561ffee3cd8041c8978d565..91d9f623e45a8f037813594990dbfc1c1766d400 100644 (file)
@@ -5,8 +5,11 @@ ikiwiki (1.39) UNRELEASED; urgency=low
   * Include the pot file in the source tarball. Closes: #405890
   * Add a Swedish translation by Daniel Nylander. Closes: #406410
   * Add a Czech translation by Miroslav Kure.
+  * Fix encoding issue with use of Locale::Gettext. Seems that the OO
+    interface returns proper utf-8 decoded strings, unlike the traditional
+    interface, so use the OO interface.
 
- -- Joey Hess <joeyh@debian.org>  Wed, 10 Jan 2007 22:24:25 -0500
+ -- Joey Hess <joeyh@debian.org>  Thu, 11 Jan 2007 18:28:05 -0500
 
 ikiwiki (1.38) unstable; urgency=low