po plugin: add correct dependencies on pages using OTHERLANGUAGES
Signed-off-by: intrigeri <intrigeri@boum.org>master
parent
93b316f7c1
commit
7b7865150f
|
@ -368,6 +368,18 @@ sub pagetemplate (@) { #{{{
|
|||
}
|
||||
if ($template->query(name => "otherlanguages")) {
|
||||
$template->param(otherlanguages => [otherlanguages($page)]);
|
||||
if (istranslatable($page)) {
|
||||
foreach my $translation (values %{$translations{$page}}) {
|
||||
add_depends($page, $translation);
|
||||
}
|
||||
}
|
||||
elsif (istranslation($page)) {
|
||||
my ($masterpage, $curlang) = ($page =~ /(.*)[.]([a-z]{2})$/);
|
||||
add_depends($page, $masterpage);
|
||||
foreach my $translation (values %{$translations{$masterpage}}) {
|
||||
add_depends($page, $translation);
|
||||
}
|
||||
}
|
||||
}
|
||||
} # }}}
|
||||
|
||||
|
|
|
@ -191,9 +191,9 @@ TODO
|
|||
OTHERLANGUAGES dependencies
|
||||
---------------------------
|
||||
|
||||
Pages using `OTHERLANGUAGES` must depend on any "master" and "slave"
|
||||
pages whose status is being displayed. It will trigger dependency
|
||||
loops; how to sort this out?
|
||||
Pages using `OTHERLANGUAGES` depend on any "master" and "slave" pages
|
||||
whose status is being displayed. It is supposed to trigger dependency
|
||||
loops, but no practical bugs were noticed yet.
|
||||
|
||||
Should pages using the `OTHERLANGUAGES` template loop be declared as
|
||||
linking to the same page in other versions? To be rigorous, they
|
||||
|
|
Loading…
Reference in New Issue