summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2008-11-10 13:00:05 +0100
committerintrigeri <intrigeri@boum.org>2008-11-10 13:14:42 +0100
commit6fc898df75223b93eba827847fd67934a65d7bee (patch)
treec1f3bd9a1b958aa89a40d06ddb52429e610c4c62
parentaef1b0f5035a1b6b6d35d831dc026118853d99d2 (diff)
po: clarify code with some comments
Signed-off-by: intrigeri <intrigeri@boum.org>
-rw-r--r--IkiWiki/Plugin/po.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm
index d2e6bbdbc..9967e4158 100644
--- a/IkiWiki/Plugin/po.pm
+++ b/IkiWiki/Plugin/po.pm
@@ -517,7 +517,9 @@ sub pagetemplate (@) { #{{{
linktext => gettext("Discussion"),
));
}
- # remove broken parentlink to ./index.html on home page's translations
+ # Remove broken parentlink to ./index.html on home page's translations.
+ # It works because this hook has the "last" parameter set, to ensure it
+ # runs after parentlinks' own pagetemplate hook.
if ($template->param('parentlinks')
&& istranslation($page)
&& $masterpage eq "index") {
@@ -535,6 +537,9 @@ sub change(@) { #{{{
next unless istranslatable($page);
my $file=srcfile($pagesources{$page});
my $updated_pot_file=0;
+ # Only refresh Pot file if it does not exist, or if
+ # $pagesources{$page} was changed: don't if only the HTML was
+ # refreshed, e.g. because of a dependency.
if ((grep { $_ eq $pagesources{$page} } @origneedsbuild)
|| ! -e potfile($file)) {
refreshpot($file);