po: fix link() pagespec when used on translation pages
authorintrigeri <intrigeri@boum.org>
Fri, 28 Aug 2009 14:34:58 +0000 (16:34 +0200)
committerintrigeri <intrigeri@boum.org>
Fri, 28 Aug 2009 14:34:58 +0000 (16:34 +0200)
Signed-off-by: intrigeri <intrigeri@boum.org>
IkiWiki/Plugin/po.pm

index 14c7318feff935209e85e317039f0cee70fe620d..21e3b8e3766bfc0cb42c9317d08b7212f4147607 100644 (file)
@@ -566,9 +566,12 @@ sub mybestlink ($$) {
        my $link=shift;
 
        my $res=$origsubs{'bestlink'}->(masterpage($page), $link);
+       my @caller = caller(1);
        if (length $res
            && istranslatable($res)
-           && istranslation($page)) {
+           && istranslation($page)
+           &&  !(exists $caller[3] && defined $caller[3]
+                 && ($caller[3] eq "IkiWiki::PageSpec::match_link"))) {
                return $res . "." . lang($page);
        }
        return $res;