diff options
author | intrigeri <intrigeri@boum.org> | 2008-10-13 17:19:56 +0200 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2008-10-18 15:49:10 +0200 |
commit | ae827a43f84bf18f971ff891d1d4f8d0c19b043c (patch) | |
tree | 672760b51219b7ba5e0f9d45d7163f177cbe07e9 | |
parent | 08df9dcef78a38ceaa12d5b93442b77df4d63573 (diff) |
po plugin: build %translations at scan time
... so that we can consider it as complete at preprocess time
Signed-off-by: intrigeri <intrigeri@boum.org>
-rw-r--r-- | IkiWiki/Plugin/po.pm | 10 | ||||
-rw-r--r-- | doc/plugins/po.mdwn | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index f29ad7a79..e06fd5043 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -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}; diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn index b587c79c4..b702414c0 100644 --- a/doc/plugins/po.mdwn +++ b/doc/plugins/po.mdwn @@ -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 ------------------------------ |