diff options
author | intrigeri <intrigeri@boum.org> | 2008-11-11 04:32:20 +0100 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2008-11-11 04:32:20 +0100 |
commit | 0d8cbfc5e0c1c1408d2d48707fefbd60c12b78a6 (patch) | |
tree | 57fc5657abee3ceb5fd65ac6a8f0012f497c9303 /IkiWiki | |
parent | d57ef863803355f37b6c0c6d6caec203dfaeeed3 (diff) |
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>
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/po.pm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 389d4e940..7deddf9ab 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -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 (@) { #{{{ my %params=@_; my $page=$params{page}; @@ -183,9 +187,10 @@ sub scan (@) { #{{{ elsif (! istranslatable($page) && ! istranslation($page)) { foreach my $destpage (@{$links{$page}}) { if (istranslatable($destpage)) { - map { - push @{$links{$page}}, $destpage . '.' . $_; - } (keys %{$config{po_slave_languages}}); + # make sure any destpage's translations has + # $page in its backlinks + push @{$links{$page}}, + values %{otherlanguages($destpage)}; } } } |