X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/163fc34db7f29bc75a05c54b83c2a00c5ad899c2..962b1c130cbbb61855e14244b7ccc9d96f9f1847:/IkiWiki/Plugin/po.pm diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index a79e7d7f0..9ed4a1adb 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -367,7 +367,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 +636,7 @@ sub mytargetpage ($$) { return $origsubs{'targetpage'}->($page, $ext); } -sub myurlto ($$;$) { +sub myurlto ($;$$) { my $to=shift; my $from=shift; my $absolute=shift; @@ -644,7 +645,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 @@ -1297,7 +1303,7 @@ sub match_lang ($$;@) { my $regexp=IkiWiki::glob2re($wanted); my $lang=IkiWiki::Plugin::po::lang($page); - if ($lang !~ /^$regexp$/i) { + if ($lang !~ $regexp) { return IkiWiki::FailReason->new("file language is $lang, not $wanted"); } else {