aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
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 86d5087f4..f12c69d5f 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -1220,4 +1220,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