summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2008-11-13 00:56:23 +0100
committerintrigeri <intrigeri@boum.org>2008-11-13 00:56:23 +0100
commit8745d67f066e3dd7e3c19f2da517711b724ba7a7 (patch)
treed3367a705cb1b3a09d404203c36d4ef93c2597fb /IkiWiki/Plugin
parentc51202c11e1729d12014a78d545bd75db05acf02 (diff)
po(istranslatablefile): extracted this from istranslatable
... will need this soon to deal with master file deletion. Signed-off-by: intrigeri <intrigeri@boum.org>
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/po.pm17
1 files changed, 11 insertions, 6 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 7039f3033..f13093963 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -501,16 +501,21 @@ sub maybe_add_leading_slash ($;$) { #{{{
return $str;
} #}}}
-sub istranslatable ($) { #{{{
- my $page=shift;
-
- $page=~s#^/##;
- my $file=$pagesources{$page};
+sub istranslatablefile ($) { #{{{
+ my $file=shift;
return 0 unless defined $file;
return 0 if (defined pagetype($file) && pagetype($file) eq 'po');
return 0 if $file =~ /\.pot$/;
- return 1 if pagespec_match($page, $config{po_translatable_pages});
+ return 1 if pagespec_match(pagename($file), $config{po_translatable_pages});
+ return;
+} #}}}
+
+sub istranslatable ($) { #{{{
+ my $page=shift;
+
+ $page=~s#^/##;
+ return 1 if istranslatablefile($pagesources{$page});
return;
} #}}}