$config{po_link_to}='default';
}
unless ($config{po_link_to} eq 'default') {
- $origsubs{'bestlink'}=\&IkiWiki::bestlink;
- inject(name => "IkiWiki::bestlink", call => \&mybestlink);
+ if (! exists $origsubs{'bestlink'}) {
+ $origsubs{'bestlink'}=\&IkiWiki::bestlink;
+ inject(name => "IkiWiki::bestlink", call => \&mybestlink);
+ }
}
push @{$config{wiki_file_prune_regexps}}, qr/\.pot$/;
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;