]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki.pm
* Fix one more missing translation of Discussion.
[ikiwiki.git] / IkiWiki.pm
index 2bef2164e69aea6ae6cc5b13f6626b01f0cebc66..292f18f5e0228207513f3a0a6a1bfa43c2dc9af2 100644 (file)
@@ -9,7 +9,7 @@ use open qw{:utf8 :std};
 
 use vars qw{%config %links %oldlinks %oldpagemtime %pagectime %pagecase
             %renderedfiles %oldrenderedfiles %pagesources %depends %hooks
-           %forcerebuild};
+           %forcerebuild $gettext_obj};
 
 use Exporter q{import};
 our @EXPORT = qw(hook debug error template htmlpage add_depends pagespec_match
@@ -83,8 +83,10 @@ sub checkconfig () { #{{{
        if (defined $config{locale}) {
                eval q{use POSIX};
                error($@) if $@;
-               $ENV{LANG} = $config{locale}
-                       if POSIX::setlocale(&POSIX::LC_ALL, $config{locale});
+               if (POSIX::setlocale(&POSIX::LC_ALL, $config{locale})) {
+                       $ENV{LANG}=$config{locale};
+                       $gettext_obj=undef;
+               }
        }
 
        if ($config{w3mmode}) {
@@ -784,7 +786,6 @@ sub file_pruned ($$) { #{{{
        $file =~ m/$regexp/;
 } #}}}
 
-my $gettext_obj;
 sub gettext { #{{{
        # Only use gettext in the rare cases it's needed.
        if (exists $ENV{LANG} || exists $ENV{LC_ALL} || exists $ENV{LC_MESSAGES}) {