X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/aed42eb34ac50912a995dee41ce7dd6e3c3b7f81..776be85a229dd951e99de519b38ba22dace260b8:/IkiWiki/Plugin/po.pm?ds=inline diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 402e960a3..1212181ca 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -262,10 +262,14 @@ sub htmlize (@) { #{{{ my $page = $params{page}; my $content = $params{content}; - my $masterfile = srcfile($pagesources{masterpage($page)}); + + # ignore PO files this plugin did not create + return $content unless istranslation($page); # force content to be htmlize'd as if it was the same type as the master page - return IkiWiki::htmlize($page, $page, pagetype($masterfile), $content); + return IkiWiki::htmlize($page, $page, + pagetype(srcfile($pagesources{masterpage($page)})), + $content); } #}}} sub pagetemplate (@) { #{{{ @@ -522,7 +526,8 @@ sub _istranslation ($) { #{{{ && defined $pagesources{$masterpage} && defined $config{po_slave_languages}{$lang}); - return (maybe_add_leading_slash($masterpage, $hasleadingslash), $lang); + return (maybe_add_leading_slash($masterpage, $hasleadingslash), $lang) + if istranslatable($masterpage); } #}}} sub istranslation ($) { #{{{ @@ -531,7 +536,8 @@ sub istranslation ($) { #{{{ if (1 < (my ($masterpage, $lang) = _istranslation($page))) { my $hasleadingslash = ($masterpage=~s#^/##); $translations{$masterpage}{$lang}=$page unless exists $translations{$masterpage}{$lang}; - return (maybe_add_leading_slash($masterpage, $hasleadingslash), $lang); + return (maybe_add_leading_slash($masterpage, $hasleadingslash), $lang) + if istranslatable($masterpage); } return; } #}}}