summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2008-11-02 20:08:38 +0100
committerintrigeri <intrigeri@boum.org>2008-11-02 20:08:38 +0100
commit2ebc0bb82dd907b6c0eaa39441378cb3bd8152d5 (patch)
tree09d6933412129bbf110abd253d056bf374f400bd /IkiWiki
parent37a9e642910628b021f0dd3cf9203f7f76f3a7cd (diff)
po plugin: fix linking from a translation to its master page
Signed-off-by: intrigeri <intrigeri@boum.org>
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/po.pm13
1 files changed, 12 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index 88f8194fb..0902322e3 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -252,6 +252,17 @@ sub mybeautify_urlpath ($) { #{{{
return $res;
} #}}}
+sub urlto_with_orig_beautiful_urlpath($$) { #{{{
+ my $to=shift;
+ my $from=shift;
+
+ inject(name => "IkiWiki::beautify_urlpath", call => $origsubs{'beautify_urlpath'});
+ my $res=urlto($to, $from);
+ inject(name => "IkiWiki::beautify_urlpath", call => \&mybeautify_urlpath);
+
+ return $res;
+} #}}}
+
sub mybestlink ($$) { #{{{
my $page=shift;
my $link=shift;
@@ -359,7 +370,7 @@ sub otherlanguages ($) { #{{{
elsif (istranslation($page)) {
my ($masterpage, $curlang) = ($page =~ /(.*)[.]([a-z]{2})$/);
push @ret, {
- url => urlto($masterpage, $page),
+ url => urlto_with_orig_beautiful_urlpath($masterpage, $page),
code => $config{po_master_language}{code},
language => $config{po_master_language}{name},
master => 1,