po: use discussionpage config setting
authorJoey Hess <joey@gnu.kitenet.net>
Fri, 14 Aug 2009 01:41:48 +0000 (21:41 -0400)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 14 Aug 2009 01:44:40 +0000 (21:44 -0400)
This was tricky. $links{$page/discussion} must be checked; with it in
lowercase.

IkiWiki/Plugin/po.pm

index 52677076ec02cde9a9465485200c1e2ec98c3e84..b8967058e47de7107be8e42a15f89fdf05fbb5d4 100644 (file)
@@ -284,17 +284,16 @@ sub pagetemplate (@) {
                map add_depends($page, $_), (values %{otherlanguages($page)});
        }
        if ($config{discussion} && istranslation($page)) {
-               my $discussionlink=gettext("discussion");
-               if ($page !~ /.*\/\Q$discussionlink\E$/i &&
+               if ($page !~ /.*\/\Q$config{discussionpage}\E$/i &&
                   (length $config{cgiurl} ||
-                   exists $links{$masterpage."/".$discussionlink})) {
+                   exists $links{$masterpage."/".lc($config{discussionpage})})) {
                        $template->param('discussionlink' => htmllink(
                                $page,
                                $destpage,
-                               $masterpage . '/' . gettext("Discussion"),
+                               $masterpage . '/' . $config{discussionpage},
                                noimageinline => 1,
                                forcesubpage => 0,
-                               linktext => gettext("Discussion"),
+                               linktext => $config{discussionpage},
                ));
                }
        }