diff options
author | intrigeri <intrigeri@boum.org> | 2008-12-31 16:45:55 +0100 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2008-12-31 16:45:55 +0100 |
commit | 885e4b607ae6cdcd48c792ce45c8b7faa29a76fb (patch) | |
tree | 771c2971ada32a176cd154ad4eb5aa376c67e93c | |
parent | be092e56395fd70df71a062492e97794650ebf40 (diff) |
po: new po_translation_status_in_links option
... to make configurable the last implemented feature.
Signed-off-by: intrigeri <intrigeri@boum.org>
-rw-r--r-- | IkiWiki/Plugin/po.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index cee7a7654..33bc2b057 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -110,6 +110,13 @@ sub getsetup () { #{{{ safe => 1, rebuild => 1, }, + po_translation_status_in_links => { + type => "boolean", + example => 1, + description => "display translation status in links to translations", + safe => 1, + rebuild => 1, + }, } #}}} sub checkconfig () { #{{{ @@ -144,6 +151,10 @@ sub checkconfig () { #{{{ warn(gettext('po_link_to=negotiated requires usedirs to be enabled, falling back to po_link_to=default')); $config{po_link_to}='default'; } + if (! exists $config{po_translation_status_in_links} || + ! defined $config{po_translation_status_in_links}) { + $config{po_translation_status_in_links}=1; + } push @{$config{wiki_file_prune_regexps}}, qr/\.pot$/; } #}}} @@ -492,6 +503,7 @@ sub mynicepagetitle ($;$) { #{{{ my $res = $origsubs{'nicepagetitle'}->($page, $unescaped); return $res unless istranslation($page); + return $res unless $config{po_translation_status_in_links}; return $res.' ('.percenttranslated($page).' %)'; } #}}} |