aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2010-06-29 15:45:34 +0200
committerintrigeri <intrigeri@boum.org>2010-06-29 15:45:34 +0200
commitb225fdc44d4b3d2853db622d59aed7b59788aeec (patch)
treeeb2eb4e88c42f116daaece5e2baee3f2fbb1b041 /IkiWiki
parentdcd57dd5c9f3265bb7a78a5696b90976698c43aa (diff)
downloadikiwiki-b225fdc44d4b3d2853db622d59aed7b59788aeec.tar
ikiwiki-b225fdc44d4b3d2853db622d59aed7b59788aeec.tar.gz
po: added a needstranslation() pagespec
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/po.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 93cf6bbdf..552b6b51b 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -1291,4 +1291,19 @@ sub match_currentlang ($$;@) {
}
}
+sub match_needstranslation ($$;@) {
+ my $page=shift;
+
+ my $percenttranslated=IkiWiki::Plugin::po::percenttranslated($page);
+ if ($percenttranslated eq 'N/A') {
+ return IkiWiki::FailReason->new("file is not a translation page");
+ }
+ elsif ($percenttranslated < 100) {
+ return IkiWiki::SuccessReason->new("file has $percenttranslated translated");
+ }
+ else {
+ return IkiWiki::FailReason->new("file is fully translated");
+ }
+}
+
1