From 6add615928581ddacd03b01de126fb098d1a8eda Mon Sep 17 00:00:00 2001 From: intrigeri Date: Wed, 15 Oct 2008 02:25:34 +0200 Subject: po plugin: added and documented PERCENTTRANSLATED template variable Signed-off-by: intrigeri --- IkiWiki/Plugin/po.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'IkiWiki/Plugin') 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)]); } -- cgit v1.2.3