From: Joey Hess Date: Thu, 4 Jun 2009 17:20:52 +0000 (-0400) Subject: fix further places where translated discussion case was assumed X-Git-Tag: 3.141~55 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/059d6f01fa7b34b67d60b99ccbc21bf188543531 fix further places where translated discussion case was assumed Another benefit is that consistently using gettext("Discussion") eliminates the need to translate one string. --- diff --git a/IkiWiki/Plugin/brokenlinks.pm b/IkiWiki/Plugin/brokenlinks.pm index da97dbc28..cf8f25281 100644 --- a/IkiWiki/Plugin/brokenlinks.pm +++ b/IkiWiki/Plugin/brokenlinks.pm @@ -30,7 +30,7 @@ sub preprocess (@) { my %broken; foreach my $page (pagespec_match_list([keys %links], $params{pages}, location => $params{page})) { - my $discussion=gettext("discussion"); + my $discussion=gettext("Discussion"); my %seen; foreach my $link (@{$links{$page}}) { next if $seen{$link}; diff --git a/IkiWiki/Plugin/editpage.pm b/IkiWiki/Plugin/editpage.pm index 8effc02d0..467cd9ed5 100644 --- a/IkiWiki/Plugin/editpage.pm +++ b/IkiWiki/Plugin/editpage.pm @@ -230,7 +230,7 @@ sub cgi_editpage ($$) { $dir=~s![^/]+/+$!!; if ((defined $form->field('subpage') && length $form->field('subpage')) || - $page eq gettext('discussion')) { + $page eq lc(gettext('Discussion'))) { $best_loc="$from/$page"; } else { diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 27ea1c4a6..9d5ebc34d 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -354,7 +354,7 @@ sub preprocess_inline (@) { my $file = $pagesources{$page}; my $type = pagetype($file); if ($config{discussion}) { - my $discussionlink=gettext("discussion"); + my $discussionlink=lc(gettext("Discussion")); if ($page !~ /.*\/\Q$discussionlink\E$/ && (length $config{cgiurl} || exists $links{$page."/".$discussionlink})) { diff --git a/IkiWiki/Plugin/opendiscussion.pm b/IkiWiki/Plugin/opendiscussion.pm index 3da01efee..60b193eca 100644 --- a/IkiWiki/Plugin/opendiscussion.pm +++ b/IkiWiki/Plugin/opendiscussion.pm @@ -23,7 +23,7 @@ sub canedit ($$) { my $cgi=shift; my $session=shift; - my $discussion=gettext("discussion"); + my $discussion=lc(gettext("Discussion")); return "" if $page=~/(\/|^)\Q$discussion\E$/; return undef; } diff --git a/IkiWiki/Plugin/orphans.pm b/IkiWiki/Plugin/orphans.pm index cf74c9b79..944eba541 100644 --- a/IkiWiki/Plugin/orphans.pm +++ b/IkiWiki/Plugin/orphans.pm @@ -34,7 +34,7 @@ sub preprocess (@) { } my @orphans; - my $discussion=gettext("discussion"); + my $discussion=lc(gettext("Discussion")); foreach my $page (pagespec_match_list( [ grep { ! $linkedto{$_} && $_ ne 'index' } keys %pagesources ], diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index ba1d1eae5..f4de19378 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -146,7 +146,7 @@ sub scan ($) { if ($config{discussion}) { # Discussion links are a special case since they're # not in the text of the page, but on its template. - $links{$page}=[ $page."/".gettext("discussion") ]; + $links{$page}=[ $page."/".lc(gettext("Discussion")) ]; } else { $links{$page}=[];