inject(name => "IkiWiki::beautify_urlpath", call => \&mybeautify_urlpath);
$origsubs{'targetpage'}=\&IkiWiki::targetpage;
inject(name => "IkiWiki::targetpage", call => \&mytargetpage);
+ $origsubs{'urlto'}=\&IkiWiki::urlto;
+ inject(name => "IkiWiki::urlto", call => \&myurlto);
} #}}}
sub getsetup () { #{{{
return File::Spec->catpath('', $dir, $name . "." . $lang . ".po");
} #}}}
+sub pofiles ($) { #{{{
+ my $masterfile=shift;
+ return map pofile($masterfile, $_), (keys %{$config{po_slave_languages}});
+} #}}}
+
sub refreshpot ($) { #{{{
my $masterfile=shift;
return $res;
} #}}}
+sub myurlto ($$;$) { #{{{
+ my $to=shift;
+ my $from=shift;
+ my $absolute=shift;
+
+ # workaround hard-coded /index.$config{htmlext} in IkiWiki::urlto()
+ if (! length $to
+ && $config{po_link_to} eq "current"
+ && istranslation($from)
+ && istranslatable('index')) {
+ my ($masterpage, $curlang) = ($from =~ /(.*)[.]([a-z]{2})$/);
+ return IkiWiki::beautify_urlpath(IkiWiki::baseurl($from) . "index." . $curlang . ".$config{htmlext}");
+ }
+ return $origsubs{'urlto'}->($to,$from,$absolute);
+} #}}}
+
sub mybestlink ($$) { #{{{
my $page=shift;
my $link=shift;