diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-01-28 02:24:43 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-01-28 02:24:43 +0000 |
commit | ab712992930e190f421a769c52843fb83867404f (patch) | |
tree | 10c8aeb19c180b993ef397339677ac53ff4f49f4 /IkiWiki.pm | |
parent | 9904d10ed9c3677b9a5f7988f743f931739b87d4 (diff) | |
download | ikiwiki-ab712992930e190f421a769c52843fb83867404f.tar ikiwiki-ab712992930e190f421a769c52843fb83867404f.tar.gz |
* More gettext fun.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r-- | IkiWiki.pm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm index 2bef2164e..292f18f5e 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -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}) { |