]> sipb.mit.edu Git - ikiwiki.git/commitdiff
po plugin: build %translations in needsbuild hook rather than scan
authorintrigeri <intrigeri@boum.org>
Tue, 14 Oct 2008 13:24:58 +0000 (15:24 +0200)
committerintrigeri <intrigeri@boum.org>
Sat, 18 Oct 2008 13:49:11 +0000 (15:49 +0200)
... because we'll need this data to refresh POT/PO files in needsbuild hook

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

index 88985cd1208fb77a75657f91f35b3ae31345a9a1..997f17fb39cee9060df1f926aa51f856f2f4c03f 100644 (file)
@@ -19,7 +19,7 @@ memoize("_istranslation");
 sub import {
        hook(type => "getsetup", id => "po", call => \&getsetup);
        hook(type => "checkconfig", id => "po", call => \&checkconfig);
-       hook(type => "scan", id => "po", call => \&scan);
+       hook(type => "needsbuild", id => "po", call => \&needsbuild);
        hook(type => "targetpage", id => "po", call => \&targetpage);
        hook(type => "tweakurlpath", id => "po", call => \&tweakurlpath);
        hook(type => "tweakbestlink", id => "po", call => \&tweakbestlink);
@@ -92,13 +92,14 @@ sub checkconfig () { #{{{
        push @{$config{wiki_file_prune_regexps}}, qr/\.pot$/;
 } #}}}
 
-sub scan (@) { #{{{
-       my %params=@_;
-       my $page=$params{page};
-       # let's build %translations, using istranslation's
-       # side-effect, so that we can consider it is complete at
-       # preprocess time
-       istranslation($page);
+sub needsbuild () { #{{{
+       my $needsbuild=shift;
+
+       # build %translations, using istranslation's side-effect
+       foreach my $page (keys %pagesources) {
+               istranslation($page);
+       }
+
 } #}}}
 
 sub targetpage (@) { #{{{