diff options
-rw-r--r-- | IkiWiki/Plugin/po.pm | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 5336de813..a37230b88 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -202,6 +202,15 @@ sub refreshpofiles ($@) { #{{{ } } #}}} +sub buildtranslationscache() { #{{{ + # use istranslation's side-effect + map istranslation($_), (keys %pagesources); +} #}}} + +sub resettranslationscache() { #{{{ + undef %translations; +} #}}} + sub needsbuild () { #{{{ my $needsbuild=shift; @@ -209,8 +218,7 @@ sub needsbuild () { #{{{ # a given master page was rendered because its source file was changed @origneedsbuild=(@$needsbuild); - # build %translations, using istranslation's side-effect - map istranslation($_), (keys %pagesources); + buildtranslationscache(); # make existing translations depend on the corresponding master page foreach my $master (keys %translations) { @@ -594,7 +602,7 @@ sub change(@) { #{{{ } # Reinitialize module's private variables. resetalreadyfiltered(); - undef %translations; + resettranslationscache(); # Trigger a wiki refresh. require IkiWiki::Render; IkiWiki::refresh(); |