diff options
author | intrigeri <intrigeri@boum.org> | 2008-10-14 15:24:58 +0200 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2008-10-18 15:49:11 +0200 |
commit | bd237d48cfd8b61639c2ccb41fb4ed27afde478e (patch) | |
tree | 93383d01a43ce5cdeba9f3bb4d2342a7eb045293 /IkiWiki | |
parent | a28559798ad8c60e79fe80f109dd8e63204cd208 (diff) |
po plugin: build %translations in needsbuild hook rather than scan
... because we'll need this data to refresh POT/PO files in needsbuild hook
Signed-off-by: intrigeri <intrigeri@boum.org>
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/po.pm | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 88985cd12..997f17fb3 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -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 (@) { #{{{ |