r105029 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105028‎ | r105029 | r105030 >
Date:00:09, 3 December 2011
Author:gregchiasson
Status:deferred (Comments)
Tags:
Comment:
More internationalization on AFTv5 Feedback page.
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php
@@ -9,6 +9,19 @@
1010 * @author Arthur Richards
1111 */
1212 $messages['en'] = array(
 13+ // Article Feedback special page.
 14+ 'articlefeedbackv5-form-optionid' => 'Option $1',
 15+ 'articlefeedbackv5-form-hide' => 'Hide this ($1)',
 16+ 'articlefeedbackv5-form-abuse' => 'Flag as abuse ($1)',
 17+ 'articlefeedbackv5-form-header' => 'Feedback #$1, at $2',
 18+ 'articlefeedbackv5-form1-header-found' => '$1 found what they were looking for:',
 19+ 'articlefeedbackv5-form1-header-not-found' => '$1 did not find what they were looking for:',
 20+ 'articlefeedbackv5-form2-header' => '$1 had a $2:',
 21+ 'articlefeedbackv5-form3-header' => '$1 rated this page $2 / 5',
 22+ 'articlefeedbackv5-form4-header' => 'User was presented with the CTA-only form.',
 23+ 'articlefeedbackv5-form5-header' => '$1 rated this page:',
 24+ 'articlefeedbackv5-form-not-shown' => 'User was not shown a feedback form.',
 25+ 'articlefeedbackv5-form-invalud' => 'Invalid feedback form ID.',
1326 'articlefeedbackv5-abuse-saved' => 'Abuse flag saved',
1427 'articlefeedbackv5-hide-saved' => 'Hide flag saved',
1528 'articlefeedbackv5-error-loading-feedback' => 'Error loading Feedback',
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php
@@ -184,8 +184,9 @@
185185
186186 protected function renderFeedback( $record ) {
187187 $id = $record[0]->af_id;
188 - $rv = "<div class='aft5-feedback'><p>Feedback #$id"
189 - .', @'.$record[0]->af_created.'</p>';
 188+ $rv = "<div class='aft5-feedback'><p>"
 189+ .wfMsg( 'articlefeedbackv5-form-header', $id, $record[0]->af_created )
 190+ .'</p>';
190191 switch( $record[0]->af_bucket_id ) {
191192 case 1: $rv .= $this->renderBucket1( $record ); break;
192193 case 2: $rv .= $this->renderBucket2( $record ); break;
@@ -195,28 +196,41 @@
196197 case 6: $rv .= $this->renderBucket6( $record ); break;
197198 default: $rv .= $this->renderNoBucket( $record ); break;
198199 }
199 - $rv .= "<p>
200 - Option ".$record[0]->af_bucket_id." |
201 - <a href='#' class='aft5-hide-link' id='aft5-hide-link-$id'>Hide this (".$record[0]->af_hide_count.")</a> |
202 - <a href='#' class='aft5-abuse-link' id='aft5-abuse-link-$id'>Flag as abuse (".$record[0]->af_abuse_count.")</a>
203 - </p>
204 - </div><hr>";
 200+ $rv .= "<p>"
 201+ .wfMsg( 'articlefeedbackv5-form-optionid', $record[0]->af_bucket_id )
 202+ ." | "
 203+ ."<a href='#' class='aft5-hide-link' id='aft5-hide-link-$id'>"
 204+ .wfMsg( 'articlefeedbackv5-form-hide', $record[0]->af_hide_count )
 205+ .'</a> | '
 206+ ."<a href='#' class='aft5-abuse-link' id='aft5-abuse-link-$id'>"
 207+ .wfMsg( 'articlefeedbackv5-form-abuse', $record[0]->af_abuse_count )
 208+ ."</a></p></div><hr>";
205209 return $rv;
206210 }
207211
208212 private function renderBucket1( $record ) {
209213 $name = $record[0]->af_user_text;
210 - $found = $record['found']->aa_response_boolean ? 'found'
211 - : 'did not find';
212 - return "$name $found what they were looking for:"
213 - .'<blockquote>'.$record['comment']->aa_response_text
 214+ if( $record['found']->aa_response_boolean ) {
 215+ $found = wfMsg(
 216+ 'articlefeedbackv5-form1-header-found',
 217+ $name
 218+ );
 219+ } else {
 220+ $found = wfMsg(
 221+ 'articlefeedbackv5-form1-header-not-found',
 222+ $name
 223+ );
 224+
 225+ }
 226+ return "$found
 227+ <blockquote>".$record['comment']->aa_response_text
214228 .'</blockquote>';
215229 }
216230
217231 private function renderBucket2( $record ) {
218232 $name = $record[0]->af_user_text;
219233 $type = $record['tag']->afo_name;
220 - return "$name had a $type:"
 234+ return wfMsg( 'articlefeedbackv5-form2-header', $name, $type )
221235 .'<blockquote>'.$record['comment']->aa_response_text
222236 .'</blockquote>';
223237 }
@@ -224,18 +238,19 @@
225239 private function renderBucket3( $record ) {
226240 $name = $record[0]->af_user_text;
227241 $rating = $record['rating']->aa_response_rating;
228 - return "$name rated this page $rating/5:"
 242+ return wfMsg( 'articlefeedbackv5-form3-header', $name, $rating )
229243 .'<blockquote>'.$record['comment']->aa_response_text
230244 .'</blockquote>';
231245 }
232246
233247 private function renderBucket4( $record ) {
234 - return 'User was presented with the CTA-only form.';
 248+ return wfMsg( 'articlefeedbackv5-form4-header' );
235249 }
236250
237251 private function renderBucket5( $record ) {
238252 $name = $record[0]->af_user_text;
239 - $rv = "$name had this to say about robocop:<ul>";
 253+ $rv = wfMsg( 'articlefeedbackv5-form5-header', $name );
 254+ $rv .= '<ul>';
240255 foreach( $record as $key => $answer ) {
241256 if( $answer->afi_data_type == 'rating' && $key != '0' ) {
242257 $rv .= "<li>".$answer->afi_name.': '.$answer->aa_response_rating."</li>";
@@ -247,16 +262,16 @@
248263 }
249264
250265 private function renderBucket0( $record ) {
251 - # Future-proof this for when the bucket ID changes.
 266+ # Future-proof this for when the bucket ID changes to 0.
252267 return $this->renderBucket6( $record );
253268 }
254269
255270 private function renderNoBucket( $record ) {
256 - return 'Invalid form ID';
 271+ return wfMsg( 'articlefeedbackv5-form-invalid' );
257272 }
258273
259274 private function renderBucket6( $record ) {
260 - return 'User was not shown a feedback form.';
 275+ return wfMsg( 'articlefeedbackv5-form-not-shown' );
261276 }
262277
263278 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r104923AFTv5 feedback page shows correct numbers for showing and total counts, and t...gregchiasson23:54, 1 December 2011
r105017Changes to AFTv5 feedback page, per Fabrice - 25 records per page, show bucke...gregchiasson22:40, 2 December 2011

Comments

#Comment by P858snake (talk | contribs)   06:11, 10 December 2011

When doing followups, Please include the revision that you are following up in the commit summary in the form of "rXXXX" please.

Status & tagging log