]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/inline.pm
optimise gettext calls
[ikiwiki.git] / IkiWiki / Plugin / inline.pm
index 04ad6ed2308526b47666ca2fe8db1ab1c199b6b4..2fbb45e02674929adfb8443df588afec2ee6116f 100644 (file)
@@ -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})) {