aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-01-11 23:29:22 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-01-11 23:29:22 +0000
commit92e26031ee6209a3b7905f7f7b1822993a327fd7 (patch)
treef02a0c6eed583b96ece9434ccae65d93b07205a3 /IkiWiki.pm
parentbd94e24566158e63e320513f0b77fe26d6dd453f (diff)
downloadikiwiki-92e26031ee6209a3b7905f7f7b1822993a327fd7.tar
ikiwiki-92e26031ee6209a3b7905f7f7b1822993a327fd7.tar.gz
* 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.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 41276e118..43ef67e8c 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -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;