r72804 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72803‎ | r72804 | r72805 >
Date:14:19, 11 September 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.4 - work on error message i18n
Modified paths:
  • /trunk/extensions/Validator/includes/criteria/CriterionHasLength.php (modified) (history)
  • /trunk/extensions/Validator/includes/criteria/CriterionInRange.php (modified) (history)
  • /trunk/extensions/Validator/includes/criteria/CriterionIsFloat.php (modified) (history)
  • /trunk/extensions/Validator/includes/criteria/CriterionIsInteger.php (modified) (history)
  • /trunk/extensions/Validator/includes/criteria/CriterionIsNumeric.php (modified) (history)
  • /trunk/extensions/Validator/includes/criteria/CriterionMatchesRegex.php (modified) (history)
  • /trunk/extensions/Validator/includes/criteria/CriterionNotEmpty.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/includes/criteria/CriterionHasLength.php
@@ -43,7 +43,12 @@
4444 * @see ItemParameterCriterion::getItemErrorMessage
4545 */
4646 protected function getItemErrorMessage( Parameter $parameter ) {
47 - return wfMsgExt( 'validator_error_invalid_argument', 'parsemag', $parameter->value );
 47+ if ( $this->lowerBound == $this->upperBound ) {
 48+ return wfMsgExt( 'validator-error-invalid-length', 'parsemag', $parameter->getOriginalName(), $this->lowerBound );
 49+ }
 50+ else {
 51+ return wfMsgExt( 'validator-error-invalid-length-range', 'parsemag', $parameter->getOriginalName(), $this->lowerBound, $this->upperBound );
 52+ }
4853 }
4954
5055 /**
Index: trunk/extensions/Validator/includes/criteria/CriterionIsNumeric.php
@@ -33,7 +33,7 @@
3434 * @see ItemParameterCriterion::getItemErrorMessage
3535 */
3636 protected function getItemErrorMessage( Parameter $parameter ) {
37 - return wfMsgExt( 'validator_error_must_be_number', 'parsemag', $parameter->value );
 37+ return wfMsgExt( 'validator_error_must_be_number', 'parsemag', $parameter->getOriginalName() );
3838 }
3939
4040 /**
Index: trunk/extensions/Validator/includes/criteria/CriterionMatchesRegex.php
@@ -46,7 +46,7 @@
4747 * @see ItemParameterCriterion::getItemErrorMessage
4848 */
4949 protected function getItemErrorMessage( Parameter $parameter ) {
50 - return wfMsgExt( 'validator_error_invalid_argument', 'parsemag', $parameter->value );
 50+ return wfMsgExt( 'validator_error_invalid_argument', 'parsemag', $parameter->value, $parameter->getOriginalName() );
5151 }
5252
5353 /**
Index: trunk/extensions/Validator/includes/criteria/CriterionNotEmpty.php
@@ -33,7 +33,7 @@
3434 * @see ItemParameterCriterion::getItemErrorMessage
3535 */
3636 protected function getItemErrorMessage( Parameter $parameter ) {
37 - return wfMsgExt( 'validator_error_empty_argument', 'parsemag', $parameter->value );
 37+ return wfMsgExt( 'validator_error_empty_argument', 'parsemag', $parameter->getOriginalName() );
3838 }
3939
4040 /**
Index: trunk/extensions/Validator/includes/criteria/CriterionIsFloat.php
@@ -33,7 +33,7 @@
3434 * @see ItemParameterCriterion::getItemErrorMessage
3535 */
3636 protected function getItemErrorMessage( Parameter $parameter ) {
37 - return wfMsgExt( 'validator_error_invalid_argument', 'parsemag', $parameter->value );
 37+ return wfMsgExt( 'validator-error-must-be-float', 'parsemag', $parameter->getOriginalName() );
3838 }
3939
4040 /**
Index: trunk/extensions/Validator/includes/criteria/CriterionInRange.php
@@ -48,7 +48,7 @@
4949 * @see ItemParameterCriterion::getItemErrorMessage
5050 */
5151 protected function getItemErrorMessage( Parameter $parameter ) {
52 - return wfMsgExt( 'validator_error_invalid_range', 'parsemag', $parameter->value );
 52+ return wfMsgExt( 'validator_error_invalid_range', 'parsemag', $parameter->getOriginalName(), $this->lowerBound, $this->upperBound );
5353 }
5454
5555 /**
Index: trunk/extensions/Validator/includes/criteria/CriterionIsInteger.php
@@ -33,7 +33,7 @@
3434 * @see ItemParameterCriterion::getItemErrorMessage
3535 */
3636 protected function getItemErrorMessage( Parameter $parameter ) {
37 - return wfMsgExt( 'validator_error_must_be_integer', 'parsemag', $parameter->value );
 37+ return wfMsgExt( 'validator_error_must_be_integer', 'parsemag', $parameter->getOriginalName() );
3838 }
3939
4040 /**

Status & tagging log