]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
po plugin: make any slave page dependent on the corresponding master page
authorintrigeri <intrigeri@boum.org>
Tue, 14 Oct 2008 22:05:52 +0000 (00:05 +0200)
committerintrigeri <intrigeri@boum.org>
Sat, 18 Oct 2008 13:49:11 +0000 (15:49 +0200)
Signed-off-by: intrigeri <intrigeri@boum.org>
IkiWiki/Plugin/po.pm
doc/plugins/po.mdwn

index ca26101b7c52c9a1a4d6b7ce38e0100196eccea0..5abe9d4195863d0bbd697d2e45370e7643826c62 100644 (file)
@@ -150,6 +150,13 @@ sub needsbuild () { #{{{
                        refreshpofiles(srcfile($file), map { srcfile($_) } @pofiles);
                }
        }
                        refreshpofiles(srcfile($file), map { srcfile($_) } @pofiles);
                }
        }
+
+       # make existing translations depend on the corresponding master page
+       foreach my $master (keys %translations) {
+               foreach my $slave (values %{$translations{$master}}) {
+                       add_depends($slave, $master);
+               }
+       }
 } #}}}
 
 sub targetpage (@) { #{{{
 } #}}}
 
 sub targetpage (@) { #{{{
index 6b04afd72f35b899352864108794c7ac289abf5f..06ecedc246dfdc9af0973646e9ec7768f76b88e3 100644 (file)
@@ -177,10 +177,9 @@ Committing changes to a "master" page must:
    this is done in the `needsbuild` hook; the updated PO files must
    then be put under version control
 
    this is done in the `needsbuild` hook; the updated PO files must
    then be put under version control
 
-2. trigger a refresh of the corresponding HTML slave pages; this can
-   be implemented by making any "slave" page depend on the
-   corresponding "master" page. The `add_depends` function can achieve
-   this, if used in a **FIXME** hook.
+2. trigger a refresh of the corresponding HTML slave pages: this is
+   achieved by making any "slave" page dependent on the corresponding
+   "master" page, in the `needsbuild` hook.
 
 Also, when the plugin has just been enabled, all the needed POT and PO
 files have to be created.
 
 Also, when the plugin has just been enabled, all the needed POT and PO
 files have to be created.