]> sipb.mit.edu Git - ikiwiki.git/commitdiff
po plugin: build %translations at scan time
authorintrigeri <intrigeri@boum.org>
Mon, 13 Oct 2008 15:19:56 +0000 (17:19 +0200)
committerintrigeri <intrigeri@boum.org>
Sat, 18 Oct 2008 13:49:10 +0000 (15:49 +0200)
... so that we can consider it as complete at preprocess time

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

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};
index b587c79c4a3c566b1dad4800c4f1edf73ca87ec1..b702414c0cb2d81beb26909481f0310297a8e8b6 100644 (file)
@@ -123,16 +123,6 @@ lighttpd unfortunately does not support content negotiation.
 TODO
 ====
 
-Optimization
-------------
-
-Pre-compute what can be early in the build process:
-
-- the list of translatable (master) pages
-- for every translatable page, the list of slave pages
-
-... and/or memoize `istranslation`/`istranslatable` function calls.
-
 Display available translations
 ------------------------------