diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-08-13 21:04:19 -0400 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-08-13 21:04:19 -0400 |
commit | 159c0c043cdd4009562087144a37fdda38eb6409 (patch) | |
tree | 8ee525ebf57336a25b9b9e9a0da10eb1efdcc049 | |
parent | 46c2d66fd37b12c2d02466118cb206000174f1b4 (diff) |
optimise gettext calls
-rw-r--r-- | IkiWiki/Plugin/brokenlinks.pm | 2 | ||||
-rw-r--r-- | IkiWiki/Plugin/inline.pm | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm index cf8f25281..f8d44892b 100644 --- a/IkiWiki/Plugin/brokenlinks.pm +++ b/IkiWiki/Plugin/brokenlinks.pm @@ -28,9 +28,9 @@ sub preprocess (@) { add_depends($params{page}, $params{pages}); my %broken; + my $discussion=gettext("Discussion"); foreach my $page (pagespec_match_list([keys %links], $params{pages}, location => $params{page})) { - my $discussion=gettext("Discussion"); my %seen; foreach my $link (@{$links{$page}}) { next if $seen{$link}; diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 04ad6ed23..2fbb45e02 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -348,6 +348,9 @@ sub preprocess_inline (@) { } my $template=HTML::Template->new(@params) unless $raw; + my $discussionlink=lc(gettext("Discussion")) + if $config{discussion}; + foreach my $page (@list) { my $file = $pagesources{$page}; my $type = pagetype($file); @@ -371,7 +374,6 @@ sub preprocess_inline (@) { my $file = $pagesources{$page}; my $type = pagetype($file); if ($config{discussion}) { - my $discussionlink=lc(gettext("Discussion")); if ($page !~ /.*\/\Q$discussionlink\E$/ && (length $config{cgiurl} || exists $links{$page."/".$discussionlink})) { |