summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2008-10-10 18:08:00 +0200
committerintrigeri <intrigeri@boum.org>2008-10-18 15:49:09 +0200
commitffd1fff775c97296c4d336cb35b9d59511c032bc (patch)
tree04414e3a700df760f390ea74736ea2b4ebaa30d6 /IkiWiki
parentb0b87d15843db10b6ff7a4e30ff8bf110e229075 (diff)
po plugin: allow pagestate update (bugfix)
Signed-off-by: intrigeri <intrigeri@boum.org>
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/po.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index d7f245e96..5042d264e 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -14,6 +14,7 @@ use File::Temp;
sub import {
hook(type => "getsetup", id => "po", call => \&getsetup);
hook(type => "checkconfig", id => "po", call => \&checkconfig);
+ 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);
@@ -72,6 +73,22 @@ sub checkconfig () { #{{{
}
} #}}}
+sub needsbuild (@) { #{{{
+ my $needsbuild=shift;
+
+ foreach my $page (keys %pagestate) {
+ if (exists $pagestate{$page}{po}{translatable}) {
+ if (exists $pagesources{$page} &&
+ grep { $_ eq $pagesources{$page} } @$needsbuild) {
+ # remove state, it will be re-added
+ # if the preprocessor directive is still
+ # there during the rebuild
+ delete $pagestate{$page}{po}{translatable};
+ }
+ }
+ }
+} #}}}
+
sub targetpage (@) { #{{{
my %params = @_;
my $page=$params{page};