]> sipb.mit.edu Git - ikiwiki.git/commitdiff
po(htmlize): ignore PO files not managed by this plugin
authorintrigeri <intrigeri@boum.org>
Wed, 12 Nov 2008 17:03:14 +0000 (18:03 +0100)
committerintrigeri <intrigeri@boum.org>
Wed, 12 Nov 2008 17:06:04 +0000 (18:06 +0100)
This way, the po plugin will not appropriate PO files it is not responsible for,
and PO files existing before this plugin was enabled can coexist peacefully with
our own ones.

Signed-off-by: intrigeri <intrigeri@boum.org>
IkiWiki/Plugin/po.pm

index 8ece342a80ea69f4e961da935630e05574c872d4..1212181ca39b5747cbc9ac635e66f1af6ea885c8 100644 (file)
@@ -262,10 +262,14 @@ sub htmlize (@) { #{{{
 
        my $page = $params{page};
        my $content = $params{content};
 
        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
 
        # 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 (@) { #{{{
 } #}}}
 
 sub pagetemplate (@) { #{{{