X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/75196e76b627709a6ecae3fa948e1fba7928a5ce..5469b9f1ef4f71c324ab2dffbd34cb7d9a2e4897:/IkiWiki/Plugin/po.pm diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 79142ed1f..4f8d5036e 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -38,7 +38,8 @@ memoize("percenttranslated"); sub import { hook(type => "getsetup", id => "po", call => \&getsetup); - hook(type => "checkconfig", id => "po", call => \&checkconfig); + hook(type => "checkconfig", id => "po", call => \&checkconfig, + last => 1); hook(type => "needsbuild", id => "po", call => \&needsbuild); hook(type => "scan", id => "po", call => \&scan, last => 1); hook(type => "filter", id => "po", call => \&filter); @@ -367,7 +368,8 @@ sub pagetemplate (@) { && $masterpage eq "index") { $template->param('parentlinks' => []); } - if (ishomepage($page) && $template->query(name => "title")) { + if (ishomepage($page) && $template->query(name => "title") + && !$template->param("title_overridden")) { $template->param(title => $config{wikiname}); } } @@ -635,7 +637,7 @@ sub mytargetpage ($$) { return $origsubs{'targetpage'}->($page, $ext); } -sub myurlto ($$;$) { +sub myurlto ($;$$) { my $to=shift; my $from=shift; my $absolute=shift; @@ -644,7 +646,12 @@ sub myurlto ($$;$) { if (! length $to && $config{po_link_to} eq "current" && istranslatable('index')) { - return IkiWiki::beautify_urlpath(IkiWiki::baseurl($from) . "index." . lang($from) . ".$config{htmlext}"); + if (defined $from) { + return IkiWiki::beautify_urlpath(IkiWiki::baseurl($from) . "index." . lang($from) . ".$config{htmlext}"); + } + else { + return $origsubs{'urlto'}->($to,$from,$absolute); + } } # avoid using our injected beautify_urlpath if run by cgi_editpage, # so that one is redirected to the just-edited page rather than to the