X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/3174b4c6f3451dd21bf91e2ae98173451a5c403f..532ec56a5f2131809f8a2709f2f1d5c1e5d0a19c:/IkiWiki/Plugin/po.pm 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();