summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/po.pm
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2008-10-15 02:25:34 +0200
committerintrigeri <intrigeri@boum.org>2008-10-18 15:49:12 +0200
commit6add615928581ddacd03b01de126fb098d1a8eda (patch)
tree65005feb26f7065d594bd7ab7f6720870be43bef /IkiWiki/Plugin/po.pm
parent1a670d3aca228fb9baed05890b175ef9aed9b102 (diff)
po plugin: added and documented PERCENTTRANSLATED template variable
Signed-off-by: intrigeri <intrigeri@boum.org>
Diffstat (limited to 'IkiWiki/Plugin/po.pm')
-rw-r--r--IkiWiki/Plugin/po.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index eee6d4058..98c070481 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -18,6 +18,7 @@ use Memoize;
my %translations;
memoize("istranslatable");
memoize("_istranslation");
+memoize("percenttranslated");
sub import {
hook(type => "getsetup", id => "po", call => \&getsetup);
@@ -318,6 +319,9 @@ sub pagetemplate (@) { #{{{
my $page=$params{page};
my $template=$params{template};
+ if (istranslation($page) && $template->query(name => "percenttranslated")) {
+ $template->param(percenttranslated => percenttranslated($page));
+ }
if ($template->query(name => "otherlanguages")) {
$template->param(otherlanguages => [otherlanguages($page)]);
}