X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/08df9dcef78a38ceaa12d5b93442b77df4d63573..32cc0b336ae830831787b2024b855ed7db0a1589:/IkiWiki/Plugin/po.pm diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index f29ad7a79..0c95f6c14 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); @@ -44,9 +45,10 @@ sub getsetup () { #{{{ }, po_slave_languages => { type => "string", - example => {'fr' => { 'name' => 'Français' }, - 'es' => { 'name' => 'Castellano' }, - 'de' => { 'name' => 'Deutsch' }, + example => { + 'fr' => 'Français', + 'es' => 'Castellano', + 'de' => 'Deutsch' }, description => "slave languages (PO files)", safe => 1, @@ -89,6 +91,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}; @@ -234,7 +245,6 @@ sub istranslation ($) { #{{{ return 0; } #}}} - package IkiWiki::PageSpec; use warnings; use strict;