po: clarify code with some comments

Signed-off-by: intrigeri <intrigeri@boum.org>
master
intrigeri 2008-11-10 13:00:05 +01:00
parent aef1b0f503
commit 6fc898df75
1 changed files with 6 additions and 1 deletions

View File

@ -517,7 +517,9 @@ sub pagetemplate (@) { #{{{
linktext => gettext("Discussion"), 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') if ($template->param('parentlinks')
&& istranslation($page) && istranslation($page)
&& $masterpage eq "index") { && $masterpage eq "index") {
@ -535,6 +537,9 @@ sub change(@) { #{{{
next unless istranslatable($page); next unless istranslatable($page);
my $file=srcfile($pagesources{$page}); my $file=srcfile($pagesources{$page});
my $updated_pot_file=0; 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) if ((grep { $_ eq $pagesources{$page} } @origneedsbuild)
|| ! -e potfile($file)) { || ! -e potfile($file)) {
refreshpot($file); refreshpot($file);