From be49679fe9235f0fe9a28dabf3d91c9ee173106f Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 29 Jun 2010 15:45:34 +0200 Subject: po: added a needstranslation() pagespec (cherry picked from commit b225fdc44d4b3d2853db622d59aed7b59788aeec) --- IkiWiki/Plugin/po.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'IkiWiki') 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 -- cgit v1.2.3