[dw-free] Poll creator: use the word "response" instead of "option"
[commit: http://hg.dwscoalition.org/dw-free/rev/71ddc6de6ae5]
http://bugs.dwscoalition.org/show_bug.cgi?id=3849
Rephrase message when we hit min/max required (when viewing/voting on a
poll).
Patch by
ninetydegrees.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=3849
Rephrase message when we hit min/max required (when viewing/voting on a
poll).
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- bin/upgrading/en.dat
- cgi-bin/LJ/Poll.pm
- cgi-bin/LJ/Poll/Question.pm
-------------------------------------------------------------------------------- diff -r 47b37cad7560 -r 71ddc6de6ae5 bin/upgrading/en.dat --- a/bin/upgrading/en.dat Tue Sep 06 18:16:58 2011 +0800 +++ b/bin/upgrading/en.dat Tue Sep 06 18:22:40 2011 +0800 @@ -2035,6 +2035,12 @@ poll.changevote=Change Your Vote +poll.checkexact=You must choose exactly <b>[[options]]</b> responses. + +poll.checkmin=You must choose at least <b>[[options]]</b> responses. + +poll.checkmax=You can choose up to <b>[[options]]</b> responses. + poll.clear=Clear Answers poll.dberror=Database error: [[errmsg]] @@ -2053,13 +2059,13 @@ poll.error.cantvote=Sorry, you don't have permission to vote in this particular poll. -poll.error.checkfewoptions=You must select at least <b>[[options]]</b> options in question <b>#[[question]]</b>, or you can choose to skip it. +poll.error.checkfewoptions2=You must select at least <b>[[options]]</b> responses in question <b>#[[question]]</b>, or you can choose to skip it. poll.error.checkmaxtoolow=Checkmax attribute must be higher than Checkmin attribute. poll.error.checkmintoolow=Checkmin attribute must be positive. -poll.error.checktoomuchoptions=You can only select up to <b>[[options]]</b> in question <b>#[[question]]</b>. +poll.error.checktoomuchoptions2=You can only select up to <b>[[options]]</b> responses in question <b>#[[question]]</b>. poll.error.missingljpoll=All poll-question (or lj-pq) tags must be nested inside an enclosing poll (or lj-poll) tag. @@ -2081,7 +2087,7 @@ poll.error.notvalidated2=You must <a [[aopts]]>confirm your email address</a> before you can vote in this poll. -poll.error.pitoolong=A poll answer must be between 1 and 255 characters. Yours is [[len]]. +poll.error.pitoolong2=A poll response must be between 1 and 255 characters. Yours is [[len]]. poll.error.pollnotfound=Error: poll #[[num]] not found @@ -2095,7 +2101,7 @@ poll.error.tagnotopen=You cannot close an [[tag]] tag that's not open. -poll.error.toomanyopts=Your poll has too many options. Each question can only have 255 possible answers. +poll.error.toomanyopts2=Your poll has too many responses. Each question can only have 255 possible responses. poll.error.toomanyquestions=You have too many questions in your poll. Polls are limited to 255 questions. diff -r 47b37cad7560 -r 71ddc6de6ae5 cgi-bin/LJ/Poll.pm --- a/cgi-bin/LJ/Poll.pm Tue Sep 06 18:16:58 2011 +0800 +++ b/cgi-bin/LJ/Poll.pm Tue Sep 06 18:22:40 2011 +0800 @@ -373,7 +373,7 @@ return $err->('poll.error.missingljpq'); } - return $err->("poll.error.toomanyopts") + return $err->( "poll.error.toomanyopts2" ) unless $numi++ < 255; if ($qopts{'type'} eq "text") @@ -457,7 +457,7 @@ $iopts{'item'} =~ s/\s+$//; my $len = length($iopts{'item'}); - return $err->('poll.error.pitoolong', { 'len' => $len, }) + return $err->( 'poll.error.pitoolong2', { 'len' => $len, } ) if $len > 255 || $len < 1; push @{$qopts{'items'}}, { %iopts }; @@ -976,15 +976,15 @@ $maxcheck ||= 255; if ($mincheck > 0 && $mincheck eq $maxcheck ) { - $results_table .= "<i>You must choose exactly <b>" . $mincheck . "</b> options</i><br />\n"; + $results_table .= "<i>". LJ::Lang::ml( "poll.checkexact", { options => $mincheck } ). "</i><br />\n"; } else { if ($mincheck > 0) { - $results_table .= "<i>You must choose at least <b>" . $mincheck . "</b> options</i><br />\n"; + $results_table .= "<i>". LJ::Lang::ml( "poll.checkmin", { options => $mincheck } ). "</i><br />\n"; } if ($maxcheck < 255) { - $results_table .= "<i>You can choose up to <b>" . $maxcheck . "</b> options</i><br />\n"; + $results_table .= "<i>". LJ::Lang::ml( "poll.checkmax", { options => $maxcheck } ). "</i><br />\n"; } } } @@ -1470,12 +1470,12 @@ $checkmax ||= 255; if($num_opts < $checkmin) { - $$error = LJ::Lang::ml('poll.error.checkfewoptions', {'question' => $qid, 'options' => $checkmin}); + $$error = LJ::Lang::ml( 'poll.error.checkfewoptions2', {'question' => $qid, 'options' => $checkmin} ); $error_code = 2; $val = ""; } if($num_opts > $checkmax) { - $$error = LJ::Lang::ml('poll.error.checktoomuchoptions', {'question' => $qid, 'options' => $checkmax}); + $$error = LJ::Lang::ml( 'poll.error.checktoomuchoptions2', {'question' => $qid, 'options' => $checkmax} ); $error_code = 2; $val = ""; } diff -r 47b37cad7560 -r 71ddc6de6ae5 cgi-bin/LJ/Poll/Question.pm --- a/cgi-bin/LJ/Poll/Question.pm Tue Sep 06 18:16:58 2011 +0800 +++ b/cgi-bin/LJ/Poll/Question.pm Tue Sep 06 18:22:40 2011 +0800 @@ -77,24 +77,24 @@ if ($qtext) { LJ::Poll->clean_poll(\$qtext); $ret .= "<p>$qtext</p>\n"; - } - if ($type eq 'check') { - my ($mincheck, $maxcheck) = split(m!/!, $opts); - $mincheck ||= 0; - $maxcheck ||= 255; - - if ($mincheck > 0 && $mincheck eq $maxcheck ) { - $ret .= "<i>You must choose exactly <b>" . $mincheck . "</b> options</i><br />\n"; - } - else { - if ($mincheck > 0) { - $ret .= "<i>You must choose at least <b>" . $mincheck . "</b> options</i><br />\n"; - } + } + if ( $type eq 'check' ) { + my ( $mincheck, $maxcheck ) = split( m!/!, $opts ); + $mincheck ||= 0; + $maxcheck ||= 255; - if ($maxcheck < 255) { - $ret .= "<i>You can choose up to <b>" . $maxcheck . "</b> options</i><br />\n"; - } - } + if ($mincheck > 0 && $mincheck eq $maxcheck ) { + $ret .= "<i>". LJ::Lang::ml( "poll.checkexact", { options => $mincheck } ). "</i><br />\n"; + } + else { + if ($mincheck > 0) { + $ret .= "<i>". LJ::Lang::ml( "poll.checkmin", { options => $mincheck } ). "</i><br />\n"; + } + + if ($maxcheck < 255) { + $ret .= "<i>". LJ::Lang::ml( "poll.checkmax", { options => $maxcheck } ). "</i><br />\n"; + } + } } $ret .= "<div style='margin: 10px 0 10px 40px'>"; --------------------------------------------------------------------------------