aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-01-16 03:37:39 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2007-01-16 03:37:39 +0000
commit04cde27a0e070af714826cf89071d27286d1d7fe (patch)
tree731ca0bda4de070910b1d411be30def865e05ac0 /IkiWiki.pm
parentcd6234f8660c651199d636595308aec0cc221f2e (diff)
downloadikiwiki-04cde27a0e070af714826cf89071d27286d1d7fe.tar
ikiwiki-04cde27a0e070af714826cf89071d27286d1d7fe.tar.gz
* Gettext 1.04 or up is needed for the OO interface that ikiwiki needs,
if an older version is installed, just don't gettext strings, instead of crashing.
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 8a3c81755..42d607b0d 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -838,8 +838,15 @@ sub gettext { #{{{
# Only use gettext in the rare cases it's needed.
if (exists $ENV{LANG} || exists $ENV{LC_ALL} || exists $ENV{LC_MESSAGES}) {
if (! $gettext_obj) {
- eval q{use Locale::gettext ''};
- $gettext_obj=Locale::gettext->domain('ikiwiki');
+ $gettext_obj=eval q{
+ use Locale::gettext q{textdomain};
+ Locale::gettext->domain('ikiwiki')
+ };
+ if ($@) {
+ print STDERR "$@";
+ $gettext_obj=undef;
+ return shift;
+ }
}
return $gettext_obj->get(shift);
}