]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/po.pm
po: fixed link to home page when po_link_to=negotiated, added testcase
[git.ikiwiki.info.git] / IkiWiki / Plugin / po.pm
index 739564c6bb01b47a866bb180128c1d04ef8b3d21..96ba467c58d63f4c2ec07a78d281c8d60759d3ef 100644 (file)
@@ -362,6 +362,10 @@ sub change(@) { #{{{
                resettranslationscache();
                # Trigger a wiki refresh.
                require IkiWiki::Render;
+               # without preliminary saveindex/loadindex, refresh()
+               # complains about a lot of uninitialized variables
+               IkiWiki::saveindex();
+               IkiWiki::loadindex();
                IkiWiki::refresh();
                IkiWiki::saveindex();
        }
@@ -402,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;
 } #}}}