summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2008-11-10 13:56:46 +0100
committerintrigeri <intrigeri@boum.org>2008-11-10 13:56:46 +0100
commit532ec56a5f2131809f8a2709f2f1d5c1e5d0a19c (patch)
tree62f4d4eaacf49d0ffc1774cad1db1f1a77f2acb8 /IkiWiki
parent3174b4c6f3451dd21bf91e2ae98173451a5c403f (diff)
po: abstract implementation details for %translations building and resetting
Signed-off-by: intrigeri <intrigeri@boum.org>
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/po.pm14
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();