r74416 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r74415‎ | r74416 | r74417 >
Date:07:32, 7 October 2010
Author:raymond
Status:ok
Tags:
Comment:
Third run of i18n review: Add PLURAL and formatNum()
Modified paths:
  • /trunk/extensions/TradeTrack/SpecialTradeTrack.php (modified) (history)
  • /trunk/extensions/TradeTrack/TradeTrack.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TradeTrack/TradeTrack.i18n.php
@@ -74,10 +74,10 @@
7575 'tradetrack-errors-other-set-but-not-checked' => 'You have entered a value for "other" but did not select it.',
7676 'tradetrack-errors-missing-other-value' => 'You selected "other" but did not provide a value for it.',
7777 'tradetrack-errors-other-too-long' => 'The value supplied for "other" is too long.
78 -The maximum length for this field is $1 characters.',
 78+The maximum length for this field is {{PLURAL:$1|$1 character|$1 characters}}.',
7979 'tradetrack-errors-generic-empty' => 'This field is required.',
8080 'tradetrack-errors-generic-too-long' => 'The value supplied for this field is too long.
81 -The maximum length allowed is $1 characters.',
 81+The maximum length allowed is {{PLURAL:$1|$1 character|$1 characters}}.',
8282 'tradetrack-errors-e-mails-do-not-match' => 'The e-mail addresses supplied do not match.',
8383 'tradetrack-errors-e-mail-fails-regex' => 'The e-mail address supplied is invalid.
8484 Please provide a valid e-mail address.',
Index: trunk/extensions/TradeTrack/SpecialTradeTrack.php
@@ -472,7 +472,7 @@
473473 * @param $request the $wgRequest object.
474474 */
475475 function validateField( $fieldName, $request ) {
476 -
 476+ global $wgLang;
477477 $value = $request->getVal( self::$VARIABLE_PREFIX . $fieldName );
478478
479479 // No need to validate. This field has no tests.
@@ -486,7 +486,7 @@
487487 case 'max':
488488 // Tests that the value does not exceed a threshold, defined in the array (max => threshold)
489489 if ( ( isset( $value ) ) && ( strlen( $value ) > $vThreshold ) ) {
490 - $this->addError( "tradetrack-elements-$fieldName", wfMsg( self::$VALIDATION_FIELDS[$fieldName]['errmsgs'][$vType], array( $vThreshold ) ) );
 490+ $this->addError( "tradetrack-elements-$fieldName", wfMsgExt( self::$VALIDATION_FIELDS[$fieldName]['errmsgs'][$vType], 'parsemag', $wgLang->formatNum( $vThreshold ) ) );
491491 }
492492 break;
493493 case 'required':

Status & tagging log