]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/po.pm
po plugin: build %translations at scan time
[ikiwiki.git] / IkiWiki / Plugin / po.pm
index f29ad7a7976e69fb85e0348eaffadb6b9b181b81..e06fd50431cacd82839db309272a805f30e38053 100644 (file)
@@ -19,6 +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 => "targetpage", id => "po", call => \&targetpage);
        hook(type => "tweakurlpath", id => "po", call => \&tweakurlpath);
        hook(type => "tweakbestlink", id => "po", call => \&tweakbestlink);
@@ -89,6 +90,15 @@ 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 targetpage (@) { #{{{
        my %params = @_;
         my $page=$params{page};