po(scan): make more clear what's being done
Mostly comments, and also a small code change: simplification and implementation details hiding. Signed-off-by: intrigeri <intrigeri@boum.org>master
parent
d57ef86380
commit
0d8cbfc5e0
|
@ -157,6 +157,10 @@ sub needsbuild () { #{{{
|
||||||
}
|
}
|
||||||
} #}}}
|
} #}}}
|
||||||
|
|
||||||
|
# Massage the recorded state of internal links so that:
|
||||||
|
# - it matches the actually generated links, rather than the links as written
|
||||||
|
# in the pages' source
|
||||||
|
# - backlinks are consistent in all cases
|
||||||
sub scan (@) { #{{{
|
sub scan (@) { #{{{
|
||||||
my %params=@_;
|
my %params=@_;
|
||||||
my $page=$params{page};
|
my $page=$params{page};
|
||||||
|
@ -183,9 +187,10 @@ sub scan (@) { #{{{
|
||||||
elsif (! istranslatable($page) && ! istranslation($page)) {
|
elsif (! istranslatable($page) && ! istranslation($page)) {
|
||||||
foreach my $destpage (@{$links{$page}}) {
|
foreach my $destpage (@{$links{$page}}) {
|
||||||
if (istranslatable($destpage)) {
|
if (istranslatable($destpage)) {
|
||||||
map {
|
# make sure any destpage's translations has
|
||||||
push @{$links{$page}}, $destpage . '.' . $_;
|
# $page in its backlinks
|
||||||
} (keys %{$config{po_slave_languages}});
|
push @{$links{$page}},
|
||||||
|
values %{otherlanguages($destpage)};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue