aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Plugin/po.pm1
-rwxr-xr-xt/po.t7
2 files changed, 5 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index a8d9b9cd9..96ba467c5 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -406,6 +406,7 @@ sub mybeautify_urlpath ($) { #{{{
my $res=$origsubs{'beautify_urlpath'}->($url);
if ($config{po_link_to} eq "negotiated") {
$res =~ s!/\Qindex.$config{po_master_language}{code}.$config{htmlext}\E$!/!;
+ $res =~ s!/\Qindex.$config{htmlext}\E$!/!;
}
return $res;
} #}}}
diff --git a/t/po.t b/t/po.t
index be446f108..02115e16f 100755
--- a/t/po.t
+++ b/t/po.t
@@ -150,10 +150,11 @@ $msgprefix="urlto (po_link_to=current)";
is(urlto('', 'index'), './index.en.html', "$msgprefix index -> ''");
is(urlto('', 'nontranslatable'), './../index.en.html', "$msgprefix nontranslatable -> ''");
is(urlto('', 'translatable.fr'), './../index.fr.html', "$msgprefix translatable.fr -> ''");
+$config{po_link_to}='negotiated';
$msgprefix="urlto (po_link_to=negotiated)";
-is(urlto('', 'index'), './index.en.html', "$msgprefix index -> ''");
-is(urlto('', 'nontranslatable'), './../index.en.html', "$msgprefix nontranslatable -> ''");
-is(urlto('', 'translatable.fr'), './../index.fr.html', "$msgprefix translatable.fr -> ''");
+is(urlto('', 'index'), './', "$msgprefix index -> ''");
+is(urlto('', 'nontranslatable'), './../', "$msgprefix nontranslatable -> ''");
+is(urlto('', 'translatable.fr'), './../', "$msgprefix translatable.fr -> ''");
### bestlink
$config{po_link_to}='current';