summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/po.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 157575483..a050d2b71 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -56,6 +56,8 @@ sub import {
inject(name => "IkiWiki::urlto", call => \&myurlto);
$origsubs{'nicepagetitle'}=\&IkiWiki::nicepagetitle;
inject(name => "IkiWiki::nicepagetitle", call => \&mynicepagetitle);
+ $origsubs{'cgiurl'}=\&IkiWiki::cgiurl;
+ inject(name => "IkiWiki::cgiurl", call => \&mycgiurl);
}
@@ -599,6 +601,16 @@ sub mynicepagetitle ($;$) {
return $res.' ('.percenttranslated($page).' %)';
}
+sub mycgiurl (@) {
+ my %params=@_;
+
+ # slave pages have no subpages
+ if (istranslation($params{'from'})) {
+ $params{'from'} = masterpage($params{'from'});
+ }
+ return $origsubs{'cgiurl'}->(%params);
+}
+
# ,----
# | Blackboxes for private data
# `----