X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/dae0f48e91304afcb6ebe0936360e51b22a56548..ac69ab522c247a0a794bc8280e1870becd291ecb:/IkiWiki/Plugin/fortune.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/fortune.pm b/IkiWiki/Plugin/fortune.pm index 43f4526af..a3b13f687 100644 --- a/IkiWiki/Plugin/fortune.pm +++ b/IkiWiki/Plugin/fortune.pm @@ -2,9 +2,9 @@ # Include a fortune in a page package IkiWiki::Plugin::fortune; -use IkiWiki; use warnings; use strict; +use IkiWiki 2.00; sub import { #{{{ hook(type => "preprocess", id => "fortune", call => \&preprocess); @@ -12,10 +12,10 @@ sub import { #{{{ sub preprocess (@) { #{{{ $ENV{PATH}="$ENV{PATH}:/usr/games:/usr/local/games"; - my $f = `fortune`; + my $f = `fortune 2>/dev/null`; if ($?) { - return "[[fortune failed]]"; + return "[[".gettext("fortune failed")."]]"; } else { return "
$f\n";