From 8745d67f066e3dd7e3c19f2da517711b724ba7a7 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Thu, 13 Nov 2008 00:56:23 +0100 Subject: po(istranslatablefile): extracted this from istranslatable ... will need this soon to deal with master file deletion. Signed-off-by: intrigeri --- IkiWiki/Plugin/po.pm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'IkiWiki/Plugin') 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; } #}}} -- cgit v1.2.3