Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php |
— | — | @@ -9,6 +9,19 @@ |
10 | 10 | * @author Arthur Richards |
11 | 11 | */ |
12 | 12 | $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.', |
13 | 26 | 'articlefeedbackv5-abuse-saved' => 'Abuse flag saved', |
14 | 27 | 'articlefeedbackv5-hide-saved' => 'Hide flag saved', |
15 | 28 | 'articlefeedbackv5-error-loading-feedback' => 'Error loading Feedback', |
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php |
— | — | @@ -184,8 +184,9 @@ |
185 | 185 | |
186 | 186 | protected function renderFeedback( $record ) { |
187 | 187 | $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>'; |
190 | 191 | switch( $record[0]->af_bucket_id ) { |
191 | 192 | case 1: $rv .= $this->renderBucket1( $record ); break; |
192 | 193 | case 2: $rv .= $this->renderBucket2( $record ); break; |
— | — | @@ -195,28 +196,41 @@ |
196 | 197 | case 6: $rv .= $this->renderBucket6( $record ); break; |
197 | 198 | default: $rv .= $this->renderNoBucket( $record ); break; |
198 | 199 | } |
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>"; |
205 | 209 | return $rv; |
206 | 210 | } |
207 | 211 | |
208 | 212 | private function renderBucket1( $record ) { |
209 | 213 | $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 |
214 | 228 | .'</blockquote>'; |
215 | 229 | } |
216 | 230 | |
217 | 231 | private function renderBucket2( $record ) { |
218 | 232 | $name = $record[0]->af_user_text; |
219 | 233 | $type = $record['tag']->afo_name; |
220 | | - return "$name had a $type:" |
| 234 | + return wfMsg( 'articlefeedbackv5-form2-header', $name, $type ) |
221 | 235 | .'<blockquote>'.$record['comment']->aa_response_text |
222 | 236 | .'</blockquote>'; |
223 | 237 | } |
— | — | @@ -224,18 +238,19 @@ |
225 | 239 | private function renderBucket3( $record ) { |
226 | 240 | $name = $record[0]->af_user_text; |
227 | 241 | $rating = $record['rating']->aa_response_rating; |
228 | | - return "$name rated this page $rating/5:" |
| 242 | + return wfMsg( 'articlefeedbackv5-form3-header', $name, $rating ) |
229 | 243 | .'<blockquote>'.$record['comment']->aa_response_text |
230 | 244 | .'</blockquote>'; |
231 | 245 | } |
232 | 246 | |
233 | 247 | private function renderBucket4( $record ) { |
234 | | - return 'User was presented with the CTA-only form.'; |
| 248 | + return wfMsg( 'articlefeedbackv5-form4-header' ); |
235 | 249 | } |
236 | 250 | |
237 | 251 | private function renderBucket5( $record ) { |
238 | 252 | $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>'; |
240 | 255 | foreach( $record as $key => $answer ) { |
241 | 256 | if( $answer->afi_data_type == 'rating' && $key != '0' ) { |
242 | 257 | $rv .= "<li>".$answer->afi_name.': '.$answer->aa_response_rating."</li>"; |
— | — | @@ -247,16 +262,16 @@ |
248 | 263 | } |
249 | 264 | |
250 | 265 | 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. |
252 | 267 | return $this->renderBucket6( $record ); |
253 | 268 | } |
254 | 269 | |
255 | 270 | private function renderNoBucket( $record ) { |
256 | | - return 'Invalid form ID'; |
| 271 | + return wfMsg( 'articlefeedbackv5-form-invalid' ); |
257 | 272 | } |
258 | 273 | |
259 | 274 | private function renderBucket6( $record ) { |
260 | | - return 'User was not shown a feedback form.'; |
| 275 | + return wfMsg( 'articlefeedbackv5-form-not-shown' ); |
261 | 276 | } |
262 | 277 | |
263 | 278 | /** |