diff options
author | intrigeri <intrigeri@boum.org> | 2011-07-18 16:34:54 +0200 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2011-07-18 16:39:18 +0200 |
commit | f5c8fca8875e2ad76134c15bc7717ccd21cb2e18 (patch) | |
tree | 8cbb48bbc3be055236130a107874027f365ffccd /IkiWiki/Plugin | |
parent | 4ce2490e01920eeb93a89b6ef5e727ab07d3678f (diff) | |
download | ikiwiki-f5c8fca8875e2ad76134c15bc7717ccd21cb2e18.tar ikiwiki-f5c8fca8875e2ad76134c15bc7717ccd21cb2e18.tar.gz |
po: add lang_code and lang_name template variables.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/po.pm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index aca3d4bf8..6410a1c66 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -343,6 +343,13 @@ sub pagetemplate (@) { if ($template->query(name => "istranslatable")) { $template->param(istranslatable => istranslatable($page)); } + my $lang_code = istranslation($page) ? lang($page) : $master_language_code; + if ($template->query(name => "lang_code")) { + $template->param(lang_code => $lang_code); + } + if ($template->query(name => "lang_name")) { + $template->param(lang_name => languagename($lang_code)); + } if ($template->query(name => "HOMEPAGEURL")) { $template->param(homepageurl => homepageurl($page)); } |