Merge remote branch 'intrigeri/po'

master
Joey Hess 2010-12-25 12:35:25 -04:00
commit c5f1c503cd
2 changed files with 10 additions and 3 deletions

View File

@ -1891,6 +1891,7 @@ sub template_depends ($$;@) {
}, },
loop_context_vars => 1, loop_context_vars => 1,
die_on_bad_params => 0, die_on_bad_params => 0,
parent_global_vars => 1,
filename => $filename, filename => $filename,
@_, @_,
($untrusted ? (no_includes => 1) : ()), ($untrusted ? (no_includes => 1) : ()),

View File

@ -367,7 +367,8 @@ sub pagetemplate (@) {
&& $masterpage eq "index") { && $masterpage eq "index") {
$template->param('parentlinks' => []); $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}); $template->param(title => $config{wikiname});
} }
} }
@ -635,7 +636,7 @@ sub mytargetpage ($$) {
return $origsubs{'targetpage'}->($page, $ext); return $origsubs{'targetpage'}->($page, $ext);
} }
sub myurlto ($$;$) { sub myurlto ($;$$) {
my $to=shift; my $to=shift;
my $from=shift; my $from=shift;
my $absolute=shift; my $absolute=shift;
@ -644,7 +645,12 @@ sub myurlto ($$;$) {
if (! length $to if (! length $to
&& $config{po_link_to} eq "current" && $config{po_link_to} eq "current"
&& istranslatable('index')) { && 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, # 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 # so that one is redirected to the just-edited page rather than to the