X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/439ba4490acbeafe6206d8723901e16ddcfc611a..7b28deb171455a207e536b8abebbca67242a4588:/IkiWiki/Plugin/po.pm diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 4608f59c7..0902322e3 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -225,7 +225,7 @@ sub mytargetpage ($$) { #{{{ if (istranslation($page)) { my ($masterpage, $lang) = ($page =~ /(.*)[.]([a-z]{2})$/); - if (! $config{usedirs} || $page eq 'index') { + if (! $config{usedirs} || $masterpage eq 'index') { return $masterpage . "." . $lang . "." . $ext; } else { @@ -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,