]> sipb.mit.edu Git - ikiwiki.git/commitdiff
po(scan): make more clear what's being done
authorintrigeri <intrigeri@boum.org>
Tue, 11 Nov 2008 03:32:20 +0000 (04:32 +0100)
committerintrigeri <intrigeri@boum.org>
Tue, 11 Nov 2008 03:32:20 +0000 (04:32 +0100)
Mostly comments, and also a small code change: simplification and implementation
details hiding.

Signed-off-by: intrigeri <intrigeri@boum.org>
IkiWiki/Plugin/po.pm

index 389d4e940b0e0839aa29b7234781227388e5b893..7deddf9abad71cd053dbb7e3887ccda9d556885d 100644 (file)
@@ -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)};
                        }
                }
        }