]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/fortune.pm
web commit by XTaran: Changed case of repo link since hgweb seems to be pickier about...
[git.ikiwiki.info.git] / IkiWiki / Plugin / fortune.pm
index 43f4526af3a99812ccfad101526b3242aabed088..a3b13f687dac48aa37eee64ddf2eb7035dbac064 100644 (file)
@@ -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 "<pre>$f</pre>\n";