X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/6a955e86bb37b490f066886968ba8ba2c56907ef..a8d313aba1094fc6d976c9ba3d09f58b768435c5:/IkiWiki/Plugin/po.pm diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index d9aa9bfda..f8801185e 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -386,8 +386,7 @@ sub change (@) { resetalreadyfiltered(); require IkiWiki::Render; foreach my $file (@rendered) { - debug(sprintf(gettext("building %s"), $file)); - IkiWiki::render($file); + IkiWiki::render($file, sprintf(gettext("building %s"), $file)); } } @@ -1058,11 +1057,8 @@ sub commit_and_refresh ($$) { IkiWiki::saveindex(); } -# on success, returns the filtered content. -# on error, if $nonfatal, warn and return undef; else, error out. -sub po_to_markup ($$;$) { +sub po_to_markup ($$) { my ($page, $content) = (shift, shift); - my $nonfatal = shift; $content = '' unless defined $content; $content = decode_utf8(encode_utf8($content)); @@ -1085,10 +1081,6 @@ sub po_to_markup ($$;$) { my $fail = sub ($) { my $msg = "po(po_to_markup) - $page : " . shift; - if ($nonfatal) { - warn $msg; - return undef; - } error($msg, sub { unlink $infile, $outfile}); }; @@ -1109,8 +1101,7 @@ sub po_to_markup ($$;$) { $doc->write($outfile) or return $fail->(sprintf(gettext("failed to write %s"), $outfile)); - $content = readfile($outfile) - or return $fail->(sprintf(gettext("failed to read %s"), $outfile)); + $content = readfile($outfile); # Unlinking should happen automatically, thanks to File::Temp, # but it does not work here, probably because of the way writefile()