aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-07-19 14:11:36 -0400
committerJoey Hess <joey@kitenet.net>2011-07-19 14:11:36 -0400
commit8512ae3ed5329a8aa69debc96f49eaa6dedeaae0 (patch)
tree94d25bdf3f15f4838c0b3f90eab3a5b2b595dd02
parent5eb8369924959d184717e87c9d35f04c0e41fe22 (diff)
parent739554622fa1caa6bcc0474ebbdcd9db3627389d (diff)
downloadikiwiki-8512ae3ed5329a8aa69debc96f49eaa6dedeaae0.tar
ikiwiki-8512ae3ed5329a8aa69debc96f49eaa6dedeaae0.tar.gz
Merge remote-tracking branch 'intrigeri/po'
-rw-r--r--IkiWiki/Plugin/po.pm7
-rw-r--r--doc/plugins/po.mdwn3
2 files changed, 10 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));
}
diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn
index f91e44ea3..b701d3662 100644
--- a/doc/plugins/po.mdwn
+++ b/doc/plugins/po.mdwn
@@ -150,6 +150,9 @@ the wiki homepage.
The `ISTRANSLATION` and `ISTRANSLATABLE` variables can be used to
display things only on translatable or translation pages.
+The `LANG_CODE` and `LANG_NAME` variables can respectively be used to
+display the current page's language code and pretty name.
+
### Display page's versions in other languages
The `OTHERLANGUAGES` loop provides ways to display other languages'