X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/8c8ce06a1b267a5c5d0b1a4f2b229b6d15e63b71..96f1a15fefd67a4a81601e6e24c29bdf1607c4d4:/IkiWiki.pm 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); }