Index: tags/extensions/Validator/REL_0_1/Validator.class.php |
— | — | @@ -0,0 +1,329 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * File holding the Validator class.
|
| 6 | + *
|
| 7 | + * @file Validator.class.php
|
| 8 | + * @ingroup Validator
|
| 9 | + *
|
| 10 | + * @author Jeroen De Dauw
|
| 11 | + */
|
| 12 | +
|
| 13 | +if ( !defined( 'MEDIAWIKI' ) ) {
|
| 14 | + die( 'Not an entry point.' );
|
| 15 | +}
|
| 16 | +
|
| 17 | +/**
|
| 18 | + * Class for parameter validation.
|
| 19 | + *
|
| 20 | + * @ingroup Validator
|
| 21 | + *
|
| 22 | + * @author Jeroen De Dauw
|
| 23 | + */
|
| 24 | +final class Validator {
|
| 25 | +
|
| 26 | + /**
|
| 27 | + * @var boolean Indicates whether parameters not found in the criteria list
|
| 28 | + * should be stored in case they are not accepted. The default is false.
|
| 29 | + */
|
| 30 | + public static $storeUnknownParameters = false;
|
| 31 | +
|
| 32 | + /**
|
| 33 | + * @var boolean Indicates whether parameters not found in the criteria list
|
| 34 | + * should be stored in case they are not accepted. The default is false.
|
| 35 | + */
|
| 36 | + public static $accumulateParameterErrors = false;
|
| 37 | +
|
| 38 | + /**
|
| 39 | + * @var array Holder for the validation functions.
|
| 40 | + */
|
| 41 | + private static $validationFunctions = array(
|
| 42 | + 'in_array' => 'in_array',
|
| 43 | + 'in_range' => array( 'ValidatorFunctions', 'in_range' ),
|
| 44 | + 'is_numeric' => 'is_numeric',
|
| 45 | + 'is_integer' => array( 'ValidatorFunctions', 'is_integer' ),
|
| 46 | + 'not_empty' => array( 'ValidatorFunctions', 'not_empty' ),
|
| 47 | + 'all_in_array' => array( 'ValidatorFunctions', 'all_in_array' ),
|
| 48 | + 'any_in_array' => array( 'ValidatorFunctions', 'any_in_array' ),
|
| 49 | + );
|
| 50 | +
|
| 51 | + private $parameterInfo;
|
| 52 | + private $rawParameters = array();
|
| 53 | +
|
| 54 | + private $valid = array();
|
| 55 | + private $invalid = array();
|
| 56 | + private $unknown = array();
|
| 57 | +
|
| 58 | + private $errors = array();
|
| 59 | +
|
| 60 | + /**
|
| 61 | + * Sets the parameter criteria, used to valiate the parameters.
|
| 62 | + *
|
| 63 | + * @param array $parameterInfo
|
| 64 | + */
|
| 65 | + public function setParameterInfo( array $parameterInfo ) {
|
| 66 | + $this->parameterInfo = $parameterInfo;
|
| 67 | + }
|
| 68 | +
|
| 69 | + /**
|
| 70 | + * Sets the raw parameters that will be validated when validateParameters is called.
|
| 71 | + *
|
| 72 | + * @param array $parameters
|
| 73 | + */
|
| 74 | + public function setParameters( array $parameters ) {
|
| 75 | + $this->rawParameters = $parameters;
|
| 76 | + }
|
| 77 | +
|
| 78 | + /**
|
| 79 | + * Valides the raw parameters, and allocates them as valid, invalid or unknown.
|
| 80 | + * Errors are collected, and can be retrieved via getErrors.
|
| 81 | + *
|
| 82 | + * @return boolean Indicates whether there where no errors.
|
| 83 | + */
|
| 84 | + public function validateParameters() {
|
| 85 | +
|
| 86 | + $parameters = array();
|
| 87 | +
|
| 88 | + // Loop through all the user provided parameters, and destinguise between those that are allowed and those that are not.
|
| 89 | + foreach ( $this->rawParameters as $paramName => $paramValue ) {
|
| 90 | + // Attempt to get the main parameter name (takes care of aliases).
|
| 91 | + $mainName = self::getMainParamName( $paramName, $this->parameterInfo );
|
| 92 | + // If the parameter is found in the list of allowed ones, add it to the $parameters array.
|
| 93 | + if ( $mainName ) {
|
| 94 | + $parameters[$mainName] = $paramValue;
|
| 95 | + }
|
| 96 | + else { // If the parameter is not found in the list of allowed ones, add an item to the $this->errors array.
|
| 97 | + if ( self::$storeUnknownParameters ) $this->unknown[$paramName] = $paramValue;
|
| 98 | + $this->errors[] = array( 'error' => array( 'unknown' ), 'name' => $paramName );
|
| 99 | + }
|
| 100 | + }
|
| 101 | +
|
| 102 | + // Loop through the list of allowed parameters.
|
| 103 | + foreach ( $this->parameterInfo as $paramName => $paramInfo ) {
|
| 104 | + // If the user provided a value for this parameter, validate and handle it.
|
| 105 | + if ( array_key_exists( $paramName, $this->rawParameters ) ) {
|
| 106 | +
|
| 107 | + $paramValue = $this->rawParameters[$paramName];
|
| 108 | + $this->cleanParameter( $paramName, $paramValue );
|
| 109 | + $validationErrors = $this->validateParameter( $paramName, $paramValue );
|
| 110 | +
|
| 111 | + if ( count( $validationErrors ) == 0 ) {
|
| 112 | + // If the validation succeeded, add the parameter to the list of valid ones.
|
| 113 | + $this->valid[$paramName] = $paramValue;
|
| 114 | + }
|
| 115 | + else {
|
| 116 | + // If the validation failed, add the parameter to the list of invalid ones and add the errors to the error list.
|
| 117 | + $this->invalid[$paramName] = $paramValue;
|
| 118 | + foreach ( $validationErrors as $error ) {
|
| 119 | + $this->errors[] = array( 'error' => $error, 'name' => $paramName );
|
| 120 | + }
|
| 121 | + }
|
| 122 | + }
|
| 123 | + else {
|
| 124 | + // If the parameter is required, add a new error of type 'missing'.
|
| 125 | + if ( array_key_exists( 'required', $paramInfo ) && $paramInfo['required'] ) {
|
| 126 | + $this->errors[] = array( 'error' => array( 'missing' ), 'name' => $paramName );
|
| 127 | + }
|
| 128 | + else {
|
| 129 | + // Set the default value (or default 'default value' if none is provided), and ensure the type is correct.
|
| 130 | + $this->valid[$paramName] = array_key_exists( 'default', $paramInfo ) ? $paramInfo['default'] : '';
|
| 131 | + $this->setFinalType($this->valid[$paramName], $paramInfo);
|
| 132 | + }
|
| 133 | + }
|
| 134 | + }
|
| 135 | +
|
| 136 | + return count( $this->errors ) == 0;
|
| 137 | + }
|
| 138 | +
|
| 139 | + /**
|
| 140 | + * Returns the main parameter name for a given parameter or alias, or false
|
| 141 | + * when it is not recognized as main parameter or alias.
|
| 142 | + *
|
| 143 | + * @param string $paramName
|
| 144 | + * @param array $allowedParms
|
| 145 | + *
|
| 146 | + * @return string
|
| 147 | + */
|
| 148 | + private function getMainParamName( $paramName, array $allowedParms ) {
|
| 149 | + $result = false;
|
| 150 | +
|
| 151 | + if ( array_key_exists( $paramName, $allowedParms ) ) {
|
| 152 | + $result = $paramName;
|
| 153 | + }
|
| 154 | + else {
|
| 155 | + foreach ( $allowedParms as $name => $data ) {
|
| 156 | + if ( array_key_exists( 'aliases', $data ) ) {
|
| 157 | + if ( in_array( $paramName, $data['aliases'] ) ) {
|
| 158 | + $result = $name;
|
| 159 | + break;
|
| 160 | + }
|
| 161 | + }
|
| 162 | + }
|
| 163 | + }
|
| 164 | +
|
| 165 | + return $result;
|
| 166 | + }
|
| 167 | +
|
| 168 | + /**
|
| 169 | + *
|
| 170 | + * @param $name
|
| 171 | + * @param $value
|
| 172 | + *
|
| 173 | + * @return unknown_type
|
| 174 | + */
|
| 175 | + private function cleanParameter( $name, &$value ) {
|
| 176 | + if (array_key_exists('default', $this->parameterInfo[$name])) {
|
| 177 | + $this->setFinalType($this->parameterInfo[$name]['default'], $this->parameterInfo[$name]);
|
| 178 | + }
|
| 179 | +
|
| 180 | + // Ensure there is a criteria array.
|
| 181 | + if (! array_key_exists('criteria', $this->parameterInfo[$name] )) {
|
| 182 | + $this->parameterInfo[$name]['criteria'] = array();
|
| 183 | + }
|
| 184 | +
|
| 185 | + if ( array_key_exists( 'type', $this->parameterInfo[$name] ) ) {
|
| 186 | + // Add type specific criteria and do type spesific manipulations.
|
| 187 | + switch(strtolower($this->parameterInfo[$name]['type'])) {
|
| 188 | + case 'integer':
|
| 189 | + $this->parameterInfo[$name]['criteria']['is_integer'] = array();
|
| 190 | + break;
|
| 191 | + case 'list' :
|
| 192 | + if (! array_key_exists('delimiter', $this->parameterInfo[$name])) $this->parameterInfo[$name]['delimiter'] = ',';
|
| 193 | + $value = explode($this->parameterInfo[$name]['delimiter'], $value);
|
| 194 | + break;
|
| 195 | + case 'list-string' :
|
| 196 | + if (! array_key_exists('delimiter', $this->parameterInfo[$name])) $this->parameterInfo[$name]['delimiter'] = ',';
|
| 197 | + break;
|
| 198 | + }
|
| 199 | +
|
| 200 | + // Remove redundant spaces.
|
| 201 | + switch(strtolower($this->parameterInfo[$name]['type'])) {
|
| 202 | + case 'list' : case 'list-string':
|
| 203 | + // TODO: make sure the delimiter doesn't mess up the regex when it's a special char.
|
| 204 | + $value = preg_replace('/((\s)*' .
|
| 205 | + $this->parameterInfo[$name]['delimiter'] .
|
| 206 | + '(\s)*)/', $this->parameterInfo[$name]['delimiter'], $value);
|
| 207 | + break;
|
| 208 | + default :
|
| 209 | + $value = trim ($value);
|
| 210 | + break;
|
| 211 | + }
|
| 212 | + }
|
| 213 | + }
|
| 214 | +
|
| 215 | + /**
|
| 216 | + * Valides the provided parameter by matching the value against the criteria for the name.
|
| 217 | + *
|
| 218 | + * @param string $name
|
| 219 | + * @param string $value
|
| 220 | + *
|
| 221 | + * @return array The errors that occured during validation.
|
| 222 | + */
|
| 223 | + private function validateParameter( $name, $value ) {
|
| 224 | + $errors = array();
|
| 225 | +
|
| 226 | + // Split list types into arrays.
|
| 227 | + if ( array_key_exists( 'type', $this->parameterInfo[$name] ) ) {
|
| 228 | + switch(strtolower($this->parameterInfo[$name]['type'])) {
|
| 229 | + case 'list-string' :
|
| 230 | + $value = explode($this->parameterInfo[$name]['delimiter'], $value);
|
| 231 | + break;
|
| 232 | + }
|
| 233 | + }
|
| 234 | +
|
| 235 | + // Go through all criteria.
|
| 236 | + foreach ( $this->parameterInfo[$name]['criteria'] as $criteriaName => $criteriaArgs ) {
|
| 237 | + // Get the validation function. If there is no matching function, throw an exception.
|
| 238 | + if (array_key_exists($criteriaName, self::$validationFunctions)) {
|
| 239 | + $validationFunction = self::$validationFunctions[$criteriaName];
|
| 240 | + }
|
| 241 | + else {
|
| 242 | + throw new Exception( 'There is no validation function for criteria type ' . $criteriaName );
|
| 243 | + }
|
| 244 | +
|
| 245 | + // Build up the array of parameters to be passed to call_user_func_array.
|
| 246 | + $arguments = array( $value );
|
| 247 | + if ( count( $criteriaArgs ) > 0 ) $arguments[] = $criteriaArgs;
|
| 248 | +
|
| 249 | + // Call the validation function and store the result.
|
| 250 | + $isValid = call_user_func_array( $validationFunction, $arguments );
|
| 251 | +
|
| 252 | + // Add a new error when the validation failed, and break the loop if errors for one parameter should not be accumulated.
|
| 253 | + if ( ! $isValid ) {
|
| 254 | + $errors[] = array( $criteriaName, $criteriaArgs, $value );
|
| 255 | + if ( ! self::$accumulateParameterErrors ) break;
|
| 256 | + }
|
| 257 | + }
|
| 258 | +
|
| 259 | + return $errors;
|
| 260 | + }
|
| 261 | +
|
| 262 | + /**
|
| 263 | + * Ensures the type of the value is correct.
|
| 264 | + *
|
| 265 | + * @param $value
|
| 266 | + * @param array $info
|
| 267 | + */
|
| 268 | + private function setFinalType(&$value, array $info) {
|
| 269 | + if (array_key_exists('type', $info)) {
|
| 270 | + switch(strtolower($info['type'])) {
|
| 271 | + case 'list-string' :
|
| 272 | + if (is_array($value)) {
|
| 273 | + $delimiter = array_key_exists('delimiter', $info) ? $info['delimiter'] : ',';
|
| 274 | + $value = implode($delimiter, $value);
|
| 275 | + }
|
| 276 | + break;
|
| 277 | + }
|
| 278 | + }
|
| 279 | + }
|
| 280 | +
|
| 281 | + /**
|
| 282 | + * Changes the invalid parameters to their default values, and changes their state to valid.
|
| 283 | + */
|
| 284 | + public function correctInvalidParams() {
|
| 285 | + foreach ( $this->invalid as $paramName => $paramValue ) {
|
| 286 | + unset( $this->invalid[$paramName] );
|
| 287 | + $this->valid[$paramName] = array_key_exists( 'default', $this->parameterInfo[$paramName] ) ? $this->parameterInfo[$paramName]['default'] : '';
|
| 288 | + $this->setFinalType($this->valid[$paramName], $this->parameterInfo[$paramName]);
|
| 289 | + }
|
| 290 | + }
|
| 291 | +
|
| 292 | + /**
|
| 293 | + * Returns the valid parameters.
|
| 294 | + *
|
| 295 | + * @return array
|
| 296 | + */
|
| 297 | + public function getValidParams() {
|
| 298 | + return $this->valid;
|
| 299 | + }
|
| 300 | +
|
| 301 | + /**
|
| 302 | + * Returns the unknown parameters.
|
| 303 | + *
|
| 304 | + * @return array
|
| 305 | + */
|
| 306 | + public static function getUnknownParams() {
|
| 307 | + return $this->unknown;
|
| 308 | + }
|
| 309 | +
|
| 310 | + /**
|
| 311 | + * Returns the errors.
|
| 312 | + *
|
| 313 | + * @return array
|
| 314 | + */
|
| 315 | + public function getErrors() {
|
| 316 | + return $this->errors;
|
| 317 | + }
|
| 318 | +
|
| 319 | + /**
|
| 320 | + * Adds a new criteria type and the validation function that should validate values of this type.
|
| 321 | + * You can use this function to override existing criteria type handlers.
|
| 322 | + *
|
| 323 | + * @param string $criteriaName The name of the cirteria.
|
| 324 | + * @param array $functionName The functions location. If it's a global function, only the name,
|
| 325 | + * if it's in a class, first the class name, then the method name.
|
| 326 | + */
|
| 327 | + public static function addValidationFunction( $criteriaName, array $functionName ) {
|
| 328 | + $this->validationFunctions[$criteriaName] = $functionName;
|
| 329 | + }
|
| 330 | +}
|
Index: tags/extensions/Validator/REL_0_1/Validator_Functions.php |
— | — | @@ -0,0 +1,98 @@ |
| 2 | +<?php
|
| 3 | +/**
|
| 4 | + * File holding the ValidatorFunctions class.
|
| 5 | + *
|
| 6 | + * @file ValidatorFunctions.php
|
| 7 | + * @ingroup Validator
|
| 8 | + *
|
| 9 | + * @author Jeroen De Dauw
|
| 10 | + */
|
| 11 | +
|
| 12 | +if ( !defined( 'MEDIAWIKI' ) ) {
|
| 13 | + die( 'Not an entry point.' );
|
| 14 | +}
|
| 15 | +
|
| 16 | +/**
|
| 17 | + * Class holding variouse static methods for the validation of parameters that have to comply to cetrain criteria.
|
| 18 | + * Functions are called by Validator with the parameters $value, $arguments, where $arguments is optional.
|
| 19 | + *
|
| 20 | + * @ingroup Validator
|
| 21 | + *
|
| 22 | + * @author Jeroen De Dauw
|
| 23 | + */
|
| 24 | +final class ValidatorFunctions {
|
| 25 | +
|
| 26 | + /**
|
| 27 | + * Returns whether the provided value, which must be a number, is within a certain range. Upper bound not included.
|
| 28 | + *
|
| 29 | + * @param $value
|
| 30 | + * @param array $limits
|
| 31 | + *
|
| 32 | + * @return boolean
|
| 33 | + */
|
| 34 | + public static function in_range( $value, array $limits ) {
|
| 35 | + if ( ! is_numeric( $value ) ) return false;
|
| 36 | + $value = (int)$value;
|
| 37 | + return ( $value >= $limits[0] && $value < $limits[1] ) || ( $value < $limits[0] And $value >= $limits[1] );
|
| 38 | + }
|
| 39 | +
|
| 40 | + /**
|
| 41 | + * Returns whether the string value is not empty. Not empty is defined as having at least one character after trimming.
|
| 42 | + *
|
| 43 | + * @param $value
|
| 44 | + *
|
| 45 | + * @return boolean
|
| 46 | + */
|
| 47 | + public static function not_empty( $value ) {
|
| 48 | + return strlen( trim( $value ) ) > 0;
|
| 49 | + }
|
| 50 | +
|
| 51 | + /**
|
| 52 | + * Returns whether a variable is an integer or an integer string. Uses the native PHP function.
|
| 53 | + *
|
| 54 | + * @param $value
|
| 55 | + *
|
| 56 | + * @return boolean
|
| 57 | + */
|
| 58 | + public static function is_integer( $value ) {
|
| 59 | + return ctype_digit( (string)$value );
|
| 60 | + }
|
| 61 | +
|
| 62 | + /**
|
| 63 | + * Returns if all items of the first array are present in the second one.
|
| 64 | + *
|
| 65 | + * @param array $needles
|
| 66 | + * @param array $haystack
|
| 67 | + *
|
| 68 | + * @return boolean
|
| 69 | + */
|
| 70 | + public static function all_in_array( array $needles, array $haystack ) {
|
| 71 | + $true = true;
|
| 72 | + foreach ( $needles as $needle ) {
|
| 73 | + if ( ! in_array( $needle , $haystack ) ) {
|
| 74 | + $true = false;
|
| 75 | + break;
|
| 76 | + }
|
| 77 | + }
|
| 78 | + return $true;
|
| 79 | + }
|
| 80 | +
|
| 81 | + /**
|
| 82 | + * Returns if any items of the first array are present in the second one.
|
| 83 | + *
|
| 84 | + * @param array $needles
|
| 85 | + * @param array $haystack
|
| 86 | + *
|
| 87 | + * @return boolean
|
| 88 | + */
|
| 89 | + public static function any_in_array( array $needles, array $haystack ) {
|
| 90 | + $true = false;
|
| 91 | + foreach ( $needles as $needle ) {
|
| 92 | + if ( in_array( $needle , $haystack ) ) {
|
| 93 | + $true = true;
|
| 94 | + break;
|
| 95 | + }
|
| 96 | + }
|
| 97 | + return $true;
|
| 98 | + }
|
| 99 | +}
|
Index: tags/extensions/Validator/REL_0_1/Validator_Manager.php |
— | — | @@ -0,0 +1,109 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * File holding the ValidatorManager class.
|
| 6 | + *
|
| 7 | + * @file ValidatorManager.php
|
| 8 | + * @ingroup Validator
|
| 9 | + *
|
| 10 | + * @author Jeroen De Dauw
|
| 11 | + */
|
| 12 | +
|
| 13 | +if ( !defined( 'MEDIAWIKI' ) ) {
|
| 14 | + die( 'Not an entry point.' );
|
| 15 | +}
|
| 16 | +
|
| 17 | +/**
|
| 18 | + * Class for parameter handling.
|
| 19 | + *
|
| 20 | + * @ingroup Validator
|
| 21 | + *
|
| 22 | + * @author Jeroen De Dauw
|
| 23 | + */
|
| 24 | +final class ValidatorManager {
|
| 25 | +
|
| 26 | + private $errors = array();
|
| 27 | +
|
| 28 | + /**
|
| 29 | + * Validates the provided parameters, and corrects them depending on the error level.
|
| 30 | + *
|
| 31 | + * @param array $rawParameters The raw parameters, as provided by the user.
|
| 32 | + * @param array $parameterInfo Array containing the parameter definitions, which are needed for validation and defaulting.
|
| 33 | + *
|
| 34 | + * @return array or false The valid parameters or false when the output should not be shown.
|
| 35 | + */
|
| 36 | + public function manageMapparameters( array $rawParameters, array $parameterInfo ) {
|
| 37 | + global $egValidatorErrorLevel;
|
| 38 | +
|
| 39 | + $validator = new Validator();
|
| 40 | +
|
| 41 | + $validator->setParameterInfo( $parameterInfo );
|
| 42 | + $validator->setParameters( $rawParameters );
|
| 43 | +
|
| 44 | + if ( ! $validator->validateParameters() ) {
|
| 45 | + if ( $egValidatorErrorLevel != Validator_ERRORS_STRICT ) $validator->correctInvalidParams();
|
| 46 | + if ( $egValidatorErrorLevel >= Validator_ERRORS_SHOW ) $this->errors = $validator->getErrors();
|
| 47 | + }
|
| 48 | +
|
| 49 | + $showOutput = ! ( $egValidatorErrorLevel == Validator_ERRORS_STRICT && count( $this->errors ) > 0 );
|
| 50 | +
|
| 51 | + return $showOutput ? $validator->getValidParams() : false;
|
| 52 | + }
|
| 53 | +
|
| 54 | + /**
|
| 55 | + * Returns a string containing an HTML error list, or an empty string when there are no errors.
|
| 56 | + *
|
| 57 | + * @return string
|
| 58 | + */
|
| 59 | + public function getErrorList() {
|
| 60 | + global $wgLang;
|
| 61 | + global $egValidatorErrorLevel;
|
| 62 | +
|
| 63 | + $error_count = count( $this->errors ) ;
|
| 64 | + if ( $egValidatorErrorLevel >= Validator_ERRORS_SHOW && $error_count > 0 ) {
|
| 65 | + $errorList = '<b>' . wfMsgExt( 'validator_error_parameters', 'parsemag', $error_count ) . ':</b><br /><i>';
|
| 66 | +
|
| 67 | + $errors = array();
|
| 68 | +
|
| 69 | + foreach ( $this->errors as $error ) {
|
| 70 | + $error['name'] = '</i>' . $error['name'] . '<i>';
|
| 71 | + switch( $error['error'][0] ) {
|
| 72 | + // General errors
|
| 73 | + case 'unknown' :
|
| 74 | + $errors[] = wfMsgExt( 'validator_error_unknown_argument', array( 'parsemag' ), $error['name'] );
|
| 75 | + break;
|
| 76 | + case 'missing' :
|
| 77 | + $errors[] = wfMsgExt( 'validator_error_required_missing', array( 'parsemag' ), $error['name'] );
|
| 78 | + break;
|
| 79 | + // Specific validation faliures
|
| 80 | + case 'not_empty' :
|
| 81 | + $errors[] = wfMsgExt( 'validator_error_empty_argument', array( 'parsemag' ), $error['name'] );
|
| 82 | + break;
|
| 83 | + case 'in_range' :
|
| 84 | + $errors[] = wfMsgExt( 'validator_error_invalid_range', array( 'parsemag' ), $error['name'], $error['error'][1][0], $error['error'][1][1] );
|
| 85 | + break;
|
| 86 | + case 'is_numeric' :
|
| 87 | + $errors[] = wfMsgExt( 'validator_error_must_be_number', array( 'parsemag' ), $error['name'] );
|
| 88 | + break;
|
| 89 | + case 'is_integer' :
|
| 90 | + $errors[] = wfMsgExt( 'validator_error_must_be_integer', array( 'parsemag' ), $error['name'] );
|
| 91 | + break;
|
| 92 | + case 'in_array' : case 'all_in_array' : case 'all_str_in_array' :
|
| 93 | + $items = $error['error'][0] == 'all_str_in_array' ? $error['error'][1][1] : $error['error'][1];
|
| 94 | + $itemsText = $wgLang->listToText( $items );
|
| 95 | + $errors[] = wfMsgExt( 'maps_error_accepts_only', array( 'parsemag' ), $error['name'], $itemsText, count( $items ) );
|
| 96 | + break;
|
| 97 | + // Unspesified errors
|
| 98 | + case 'invalid' : default :
|
| 99 | + $errors[] = wfMsgExt( 'validator_error_invalid_argument', array( 'parsemag' ), $error['error'][2], $error['name'] );
|
| 100 | + break;
|
| 101 | + }
|
| 102 | + }
|
| 103 | +
|
| 104 | + return $errorList . implode( $errors, '<br />' ) . '</i><br />';
|
| 105 | + }
|
| 106 | + else {
|
| 107 | + return '';
|
| 108 | + }
|
| 109 | + }
|
| 110 | +}
|
Index: tags/extensions/Validator/REL_0_1/INSTALL |
— | — | @@ -0,0 +1,11 @@ |
| 2 | +[[Validator 0.1]]
|
| 3 | +
|
| 4 | +Once you have downloaded the code, place the 'SemanticMaps' directory within
|
| 5 | +your MediaWiki 'extensions' directory. Then add the following code to your
|
| 6 | +LocalSettings.php file BEFORE the inclusion of any extensions using Validator:
|
| 7 | +
|
| 8 | +# Validator
|
| 9 | +require_once( "$IP/extensions/Validator/Validator.php" );
|
| 10 | +
|
| 11 | +
|
| 12 | +More information can be found at http://www.mediawiki.org/wiki/Extension:Validator#Setup |
\ No newline at end of file |
Index: tags/extensions/Validator/REL_0_1/RELEASE-NOTES |
— | — | @@ -0,0 +1,9 @@ |
| 2 | +For a documentation of all features, see http://www.mediawiki.org/wiki/Extension:Validator
|
| 3 | +
|
| 4 | +== Validator change log ==
|
| 5 | +This change log contains a list of completed to-do's (new features, bug fixes, refactoring) for every version of Validator.
|
| 6 | +
|
| 7 | +=== Validator 0.1 ===
|
| 8 | +(2009-12-17)
|
| 9 | +
|
| 10 | +* Initial release, featuring parameter validation, defaulting and error generation.
|
Index: tags/extensions/Validator/REL_0_1/COPYING |
— | — | @@ -0,0 +1,348 @@ |
| 2 | +The license text below "----" applies to all files within this distribution, other
|
| 3 | +than those that are in a directory which contains files named "LICENSE" or
|
| 4 | +"COPYING", or a subdirectory thereof. For those files, the license text contained in
|
| 5 | +said file overrides any license information contained in directories of smaller depth.
|
| 6 | +Alternative licenses are typically used for software that is provided by external
|
| 7 | +parties, and merely packaged with the Semantic MediaWiki release for convenience.
|
| 8 | +----
|
| 9 | +
|
| 10 | + GNU GENERAL PUBLIC LICENSE
|
| 11 | + Version 2, June 1991
|
| 12 | +
|
| 13 | + Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
| 14 | + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
| 15 | + Everyone is permitted to copy and distribute verbatim copies
|
| 16 | + of this license document, but changing it is not allowed.
|
| 17 | +
|
| 18 | + Preamble
|
| 19 | +
|
| 20 | + The licenses for most software are designed to take away your
|
| 21 | +freedom to share and change it. By contrast, the GNU General Public
|
| 22 | +License is intended to guarantee your freedom to share and change free
|
| 23 | +software--to make sure the software is free for all its users. This
|
| 24 | +General Public License applies to most of the Free Software
|
| 25 | +Foundation's software and to any other program whose authors commit to
|
| 26 | +using it. (Some other Free Software Foundation software is covered by
|
| 27 | +the GNU Library General Public License instead.) You can apply it to
|
| 28 | +your programs, too.
|
| 29 | +
|
| 30 | + When we speak of free software, we are referring to freedom, not
|
| 31 | +price. Our General Public Licenses are designed to make sure that you
|
| 32 | +have the freedom to distribute copies of free software (and charge for
|
| 33 | +this service if you wish), that you receive source code or can get it
|
| 34 | +if you want it, that you can change the software or use pieces of it
|
| 35 | +in new free programs; and that you know you can do these things.
|
| 36 | +
|
| 37 | + To protect your rights, we need to make restrictions that forbid
|
| 38 | +anyone to deny you these rights or to ask you to surrender the rights.
|
| 39 | +These restrictions translate to certain responsibilities for you if you
|
| 40 | +distribute copies of the software, or if you modify it.
|
| 41 | +
|
| 42 | + For example, if you distribute copies of such a program, whether
|
| 43 | +gratis or for a fee, you must give the recipients all the rights that
|
| 44 | +you have. You must make sure that they, too, receive or can get the
|
| 45 | +source code. And you must show them these terms so they know their
|
| 46 | +rights.
|
| 47 | +
|
| 48 | + We protect your rights with two steps: (1) copyright the software, and
|
| 49 | +(2) offer you this license which gives you legal permission to copy,
|
| 50 | +distribute and/or modify the software.
|
| 51 | +
|
| 52 | + Also, for each author's protection and ours, we want to make certain
|
| 53 | +that everyone understands that there is no warranty for this free
|
| 54 | +software. If the software is modified by someone else and passed on, we
|
| 55 | +want its recipients to know that what they have is not the original, so
|
| 56 | +that any problems introduced by others will not reflect on the original
|
| 57 | +authors' reputations.
|
| 58 | +
|
| 59 | + Finally, any free program is threatened constantly by software
|
| 60 | +patents. We wish to avoid the danger that redistributors of a free
|
| 61 | +program will individually obtain patent licenses, in effect making the
|
| 62 | +program proprietary. To prevent this, we have made it clear that any
|
| 63 | +patent must be licensed for everyone's free use or not licensed at all.
|
| 64 | +
|
| 65 | + The precise terms and conditions for copying, distribution and
|
| 66 | +modification follow.
|
| 67 | +
|
| 68 | + GNU GENERAL PUBLIC LICENSE
|
| 69 | + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
| 70 | +
|
| 71 | + 0. This License applies to any program or other work which contains
|
| 72 | +a notice placed by the copyright holder saying it may be distributed
|
| 73 | +under the terms of this General Public License. The "Program", below,
|
| 74 | +refers to any such program or work, and a "work based on the Program"
|
| 75 | +means either the Program or any derivative work under copyright law:
|
| 76 | +that is to say, a work containing the Program or a portion of it,
|
| 77 | +either verbatim or with modifications and/or translated into another
|
| 78 | +language. (Hereinafter, translation is included without limitation in
|
| 79 | +the term "modification".) Each licensee is addressed as "you".
|
| 80 | +
|
| 81 | +Activities other than copying, distribution and modification are not
|
| 82 | +covered by this License; they are outside its scope. The act of
|
| 83 | +running the Program is not restricted, and the output from the Program
|
| 84 | +is covered only if its contents constitute a work based on the
|
| 85 | +Program (independent of having been made by running the Program).
|
| 86 | +Whether that is true depends on what the Program does.
|
| 87 | +
|
| 88 | + 1. You may copy and distribute verbatim copies of the Program's
|
| 89 | +source code as you receive it, in any medium, provided that you
|
| 90 | +conspicuously and appropriately publish on each copy an appropriate
|
| 91 | +copyright notice and disclaimer of warranty; keep intact all the
|
| 92 | +notices that refer to this License and to the absence of any warranty;
|
| 93 | +and give any other recipients of the Program a copy of this License
|
| 94 | +along with the Program.
|
| 95 | +
|
| 96 | +You may charge a fee for the physical act of transferring a copy, and
|
| 97 | +you may at your option offer warranty protection in exchange for a fee.
|
| 98 | +
|
| 99 | + 2. You may modify your copy or copies of the Program or any portion
|
| 100 | +of it, thus forming a work based on the Program, and copy and
|
| 101 | +distribute such modifications or work under the terms of Section 1
|
| 102 | +above, provided that you also meet all of these conditions:
|
| 103 | +
|
| 104 | + a) You must cause the modified files to carry prominent notices
|
| 105 | + stating that you changed the files and the date of any change.
|
| 106 | +
|
| 107 | + b) You must cause any work that you distribute or publish, that in
|
| 108 | + whole or in part contains or is derived from the Program or any
|
| 109 | + part thereof, to be licensed as a whole at no charge to all third
|
| 110 | + parties under the terms of this License.
|
| 111 | +
|
| 112 | + c) If the modified program normally reads commands interactively
|
| 113 | + when run, you must cause it, when started running for such
|
| 114 | + interactive use in the most ordinary way, to print or display an
|
| 115 | + announcement including an appropriate copyright notice and a
|
| 116 | + notice that there is no warranty (or else, saying that you provide
|
| 117 | + a warranty) and that users may redistribute the program under
|
| 118 | + these conditions, and telling the user how to view a copy of this
|
| 119 | + License. (Exception: if the Program itself is interactive but
|
| 120 | + does not normally print such an announcement, your work based on
|
| 121 | + the Program is not required to print an announcement.)
|
| 122 | +
|
| 123 | +These requirements apply to the modified work as a whole. If
|
| 124 | +identifiable sections of that work are not derived from the Program,
|
| 125 | +and can be reasonably considered independent and separate works in
|
| 126 | +themselves, then this License, and its terms, do not apply to those
|
| 127 | +sections when you distribute them as separate works. But when you
|
| 128 | +distribute the same sections as part of a whole which is a work based
|
| 129 | +on the Program, the distribution of the whole must be on the terms of
|
| 130 | +this License, whose permissions for other licensees extend to the
|
| 131 | +entire whole, and thus to each and every part regardless of who wrote it.
|
| 132 | +
|
| 133 | +Thus, it is not the intent of this section to claim rights or contest
|
| 134 | +your rights to work written entirely by you; rather, the intent is to
|
| 135 | +exercise the right to control the distribution of derivative or
|
| 136 | +collective works based on the Program.
|
| 137 | +
|
| 138 | +In addition, mere aggregation of another work not based on the Program
|
| 139 | +with the Program (or with a work based on the Program) on a volume of
|
| 140 | +a storage or distribution medium does not bring the other work under
|
| 141 | +the scope of this License.
|
| 142 | +
|
| 143 | + 3. You may copy and distribute the Program (or a work based on it,
|
| 144 | +under Section 2) in object code or executable form under the terms of
|
| 145 | +Sections 1 and 2 above provided that you also do one of the following:
|
| 146 | +
|
| 147 | + a) Accompany it with the complete corresponding machine-readable
|
| 148 | + source code, which must be distributed under the terms of Sections
|
| 149 | + 1 and 2 above on a medium customarily used for software interchange; or,
|
| 150 | +
|
| 151 | + b) Accompany it with a written offer, valid for at least three
|
| 152 | + years, to give any third party, for a charge no more than your
|
| 153 | + cost of physically performing source distribution, a complete
|
| 154 | + machine-readable copy of the corresponding source code, to be
|
| 155 | + distributed under the terms of Sections 1 and 2 above on a medium
|
| 156 | + customarily used for software interchange; or,
|
| 157 | +
|
| 158 | + c) Accompany it with the information you received as to the offer
|
| 159 | + to distribute corresponding source code. (This alternative is
|
| 160 | + allowed only for noncommercial distribution and only if you
|
| 161 | + received the program in object code or executable form with such
|
| 162 | + an offer, in accord with Subsection b above.)
|
| 163 | +
|
| 164 | +The source code for a work means the preferred form of the work for
|
| 165 | +making modifications to it. For an executable work, complete source
|
| 166 | +code means all the source code for all modules it contains, plus any
|
| 167 | +associated interface definition files, plus the scripts used to
|
| 168 | +control compilation and installation of the executable. However, as a
|
| 169 | +special exception, the source code distributed need not include
|
| 170 | +anything that is normally distributed (in either source or binary
|
| 171 | +form) with the major components (compiler, kernel, and so on) of the
|
| 172 | +operating system on which the executable runs, unless that component
|
| 173 | +itself accompanies the executable.
|
| 174 | +
|
| 175 | +If distribution of executable or object code is made by offering
|
| 176 | +access to copy from a designated place, then offering equivalent
|
| 177 | +access to copy the source code from the same place counts as
|
| 178 | +distribution of the source code, even though third parties are not
|
| 179 | +compelled to copy the source along with the object code.
|
| 180 | +
|
| 181 | + 4. You may not copy, modify, sublicense, or distribute the Program
|
| 182 | +except as expressly provided under this License. Any attempt
|
| 183 | +otherwise to copy, modify, sublicense or distribute the Program is
|
| 184 | +void, and will automatically terminate your rights under this License.
|
| 185 | +However, parties who have received copies, or rights, from you under
|
| 186 | +this License will not have their licenses terminated so long as such
|
| 187 | +parties remain in full compliance.
|
| 188 | +
|
| 189 | + 5. You are not required to accept this License, since you have not
|
| 190 | +signed it. However, nothing else grants you permission to modify or
|
| 191 | +distribute the Program or its derivative works. These actions are
|
| 192 | +prohibited by law if you do not accept this License. Therefore, by
|
| 193 | +modifying or distributing the Program (or any work based on the
|
| 194 | +Program), you indicate your acceptance of this License to do so, and
|
| 195 | +all its terms and conditions for copying, distributing or modifying
|
| 196 | +the Program or works based on it.
|
| 197 | +
|
| 198 | + 6. Each time you redistribute the Program (or any work based on the
|
| 199 | +Program), the recipient automatically receives a license from the
|
| 200 | +original licensor to copy, distribute or modify the Program subject to
|
| 201 | +these terms and conditions. You may not impose any further
|
| 202 | +restrictions on the recipients' exercise of the rights granted herein.
|
| 203 | +You are not responsible for enforcing compliance by third parties to
|
| 204 | +this License.
|
| 205 | +
|
| 206 | + 7. If, as a consequence of a court judgment or allegation of patent
|
| 207 | +infringement or for any other reason (not limited to patent issues),
|
| 208 | +conditions are imposed on you (whether by court order, agreement or
|
| 209 | +otherwise) that contradict the conditions of this License, they do not
|
| 210 | +excuse you from the conditions of this License. If you cannot
|
| 211 | +distribute so as to satisfy simultaneously your obligations under this
|
| 212 | +License and any other pertinent obligations, then as a consequence you
|
| 213 | +may not distribute the Program at all. For example, if a patent
|
| 214 | +license would not permit royalty-free redistribution of the Program by
|
| 215 | +all those who receive copies directly or indirectly through you, then
|
| 216 | +the only way you could satisfy both it and this License would be to
|
| 217 | +refrain entirely from distribution of the Program.
|
| 218 | +
|
| 219 | +If any portion of this section is held invalid or unenforceable under
|
| 220 | +any particular circumstance, the balance of the section is intended to
|
| 221 | +apply and the section as a whole is intended to apply in other
|
| 222 | +circumstances.
|
| 223 | +
|
| 224 | +It is not the purpose of this section to induce you to infringe any
|
| 225 | +patents or other property right claims or to contest validity of any
|
| 226 | +such claims; this section has the sole purpose of protecting the
|
| 227 | +integrity of the free software distribution system, which is
|
| 228 | +implemented by public license practices. Many people have made
|
| 229 | +generous contributions to the wide range of software distributed
|
| 230 | +through that system in reliance on consistent application of that
|
| 231 | +system; it is up to the author/donor to decide if he or she is willing
|
| 232 | +to distribute software through any other system and a licensee cannot
|
| 233 | +impose that choice.
|
| 234 | +
|
| 235 | +This section is intended to make thoroughly clear what is believed to
|
| 236 | +be a consequence of the rest of this License.
|
| 237 | +
|
| 238 | + 8. If the distribution and/or use of the Program is restricted in
|
| 239 | +certain countries either by patents or by copyrighted interfaces, the
|
| 240 | +original copyright holder who places the Program under this License
|
| 241 | +may add an explicit geographical distribution limitation excluding
|
| 242 | +those countries, so that distribution is permitted only in or among
|
| 243 | +countries not thus excluded. In such case, this License incorporates
|
| 244 | +the limitation as if written in the body of this License.
|
| 245 | +
|
| 246 | + 9. The Free Software Foundation may publish revised and/or new versions
|
| 247 | +of the General Public License from time to time. Such new versions will
|
| 248 | +be similar in spirit to the present version, but may differ in detail to
|
| 249 | +address new problems or concerns.
|
| 250 | +
|
| 251 | +Each version is given a distinguishing version number. If the Program
|
| 252 | +specifies a version number of this License which applies to it and "any
|
| 253 | +later version", you have the option of following the terms and conditions
|
| 254 | +either of that version or of any later version published by the Free
|
| 255 | +Software Foundation. If the Program does not specify a version number of
|
| 256 | +this License, you may choose any version ever published by the Free Software
|
| 257 | +Foundation.
|
| 258 | +
|
| 259 | + 10. If you wish to incorporate parts of the Program into other free
|
| 260 | +programs whose distribution conditions are different, write to the author
|
| 261 | +to ask for permission. For software which is copyrighted by the Free
|
| 262 | +Software Foundation, write to the Free Software Foundation; we sometimes
|
| 263 | +make exceptions for this. Our decision will be guided by the two goals
|
| 264 | +of preserving the free status of all derivatives of our free software and
|
| 265 | +of promoting the sharing and reuse of software generally.
|
| 266 | +
|
| 267 | + NO WARRANTY
|
| 268 | +
|
| 269 | + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
| 270 | +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
| 271 | +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
| 272 | +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
| 273 | +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
| 274 | +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
| 275 | +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
| 276 | +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
| 277 | +REPAIR OR CORRECTION.
|
| 278 | +
|
| 279 | + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
| 280 | +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
| 281 | +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
| 282 | +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
| 283 | +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
| 284 | +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
| 285 | +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
| 286 | +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
| 287 | +POSSIBILITY OF SUCH DAMAGES.
|
| 288 | +
|
| 289 | + END OF TERMS AND CONDITIONS
|
| 290 | +
|
| 291 | + How to Apply These Terms to Your New Programs
|
| 292 | +
|
| 293 | + If you develop a new program, and you want it to be of the greatest
|
| 294 | +possible use to the public, the best way to achieve this is to make it
|
| 295 | +free software which everyone can redistribute and change under these terms.
|
| 296 | +
|
| 297 | + To do so, attach the following notices to the program. It is safest
|
| 298 | +to attach them to the start of each source file to most effectively
|
| 299 | +convey the exclusion of warranty; and each file should have at least
|
| 300 | +the "copyright" line and a pointer to where the full notice is found.
|
| 301 | +
|
| 302 | + <one line to give the program's name and a brief idea of what it does.>
|
| 303 | + Copyright (C) <year> <name of author>
|
| 304 | +
|
| 305 | + This program is free software; you can redistribute it and/or modify
|
| 306 | + it under the terms of the GNU General Public License as published by
|
| 307 | + the Free Software Foundation; either version 2 of the License, or
|
| 308 | + (at your option) any later version.
|
| 309 | +
|
| 310 | + This program is distributed in the hope that it will be useful,
|
| 311 | + but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 312 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 313 | + GNU General Public License for more details.
|
| 314 | +
|
| 315 | + You should have received a copy of the GNU General Public License
|
| 316 | + along with this program; if not, write to the Free Software
|
| 317 | + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
| 318 | +
|
| 319 | +
|
| 320 | +Also add information on how to contact you by electronic and paper mail.
|
| 321 | +
|
| 322 | +If the program is interactive, make it output a short notice like this
|
| 323 | +when it starts in an interactive mode:
|
| 324 | +
|
| 325 | + Gnomovision version 69, Copyright (C) year name of author
|
| 326 | + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
| 327 | + This is free software, and you are welcome to redistribute it
|
| 328 | + under certain conditions; type `show c' for details.
|
| 329 | +
|
| 330 | +The hypothetical commands `show w' and `show c' should show the appropriate
|
| 331 | +parts of the General Public License. Of course, the commands you use may
|
| 332 | +be called something other than `show w' and `show c'; they could even be
|
| 333 | +mouse-clicks or menu items--whatever suits your program.
|
| 334 | +
|
| 335 | +You should also get your employer (if you work as a programmer) or your
|
| 336 | +school, if any, to sign a "copyright disclaimer" for the program, if
|
| 337 | +necessary. Here is a sample; alter the names:
|
| 338 | +
|
| 339 | + Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
| 340 | + `Gnomovision' (which makes passes at compilers) written by James Hacker.
|
| 341 | +
|
| 342 | + <signature of Ty Coon>, 1 April 1989
|
| 343 | + Ty Coon, President of Vice
|
| 344 | +
|
| 345 | +This General Public License does not permit incorporating your program into
|
| 346 | +proprietary programs. If your program is a subroutine library, you may
|
| 347 | +consider it more useful to permit linking proprietary applications with the
|
| 348 | +library. If this is what you want to do, use the GNU Library General
|
| 349 | +Public License instead of this License.
|
Index: tags/extensions/Validator/REL_0_1/Validator.i18n.php |
— | — | @@ -0,0 +1,463 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * Internationalization file for the Validator extension
|
| 6 | + *
|
| 7 | + * @file Validator.i18n.php
|
| 8 | + * @ingroup Validator
|
| 9 | + *
|
| 10 | + * @author Jeroen De Dauw
|
| 11 | +*/
|
| 12 | +
|
| 13 | +$messages = array();
|
| 14 | +
|
| 15 | +/** English
|
| 16 | + * @author Jeroen De Dauw
|
| 17 | + */
|
| 18 | +$messages['en'] = array(
|
| 19 | + 'validator_name' => 'Validator',
|
| 20 | + 'validator-desc' => 'Validator provides an easy way for other extensions to validate parameters of parser functions and tag extensions, set default values and generate error messages',
|
| 21 | +
|
| 22 | + 'validator_error_parameters' => 'The following {{PLURAL:$1|error has|errors have}} been detected in your syntax',
|
| 23 | +
|
| 24 | + 'validator_error_unknown_argument' => '$1 is not a valid parameter.',
|
| 25 | + 'validator_error_invalid_argument' => 'The value $1 is not valid for parameter $2.',
|
| 26 | + 'validator_error_empty_argument' => 'Parameter $1 can not have an empty value.',
|
| 27 | + 'validator_error_required_missing' => 'The required parameter $1 is not provided.',
|
| 28 | +
|
| 29 | + 'validator_error_must_be_number' => 'Parameter $1 can only be a number.',
|
| 30 | + 'validator_error_must_be_integer' => 'Parameter $1 can only be an integer.',
|
| 31 | + 'validator_error_invalid_range' => 'Parameter $1 must be between $2 and $3.',
|
| 32 | + 'maps_error_accepts_only' => 'Parameter $1 only accepts {{PLURAL:$3|this value|these values}}: $2.',
|
| 33 | +);
|
| 34 | +
|
| 35 | +/** Message documentation (Message documentation)
|
| 36 | + * @author Fryed-peach
|
| 37 | + * @author Purodha
|
| 38 | + */
|
| 39 | +$messages['qqq'] = array(
|
| 40 | + 'validator-desc' => '{{desc}}',
|
| 41 | + 'validator_error_parameters' => 'Parameters:
|
| 42 | +* $1 is the number of syntax errors, for PLURAL support (optional)',
|
| 43 | +);
|
| 44 | +
|
| 45 | +/** Afrikaans (Afrikaans)
|
| 46 | + * @author Naudefj
|
| 47 | + */
|
| 48 | +$messages['af'] = array(
|
| 49 | + 'validator_name' => 'Valideerder',
|
| 50 | + 'validator-desc' => 'Die valideerder gee ander uitbreidings die vermoë om parameters van ontlederfunksies en etiket-uitbreidings te valideer, op hulle verstekwaardes in te stel en om foutboodskappe te genereer',
|
| 51 | + 'validator_error_parameters' => 'Die volgende {{PLURAL:$1|fout|foute}} is in u sintaks waargeneem',
|
| 52 | + 'validator_error_unknown_argument' => "$1 is nie 'n geldige parameter nie.",
|
| 53 | + 'validator_error_invalid_argument' => 'Die waarde $1 is nie geldig vir parameter $2 nie.',
|
| 54 | + 'validator_error_empty_argument' => 'Die parameter $1 mag nie leeg wees nie.',
|
| 55 | + 'validator_error_required_missing' => 'Die verpligte parameter $1 is nie verskaf nie.',
|
| 56 | + 'validator_error_must_be_number' => "Die parameter $1 mag net 'n getal wees.",
|
| 57 | + 'validator_error_must_be_integer' => "Die parameter $1 kan slegs 'n heelgetal wees.",
|
| 58 | + 'validator_error_invalid_range' => 'Die parameter $1 moet tussen $2 en $3 lê.',
|
| 59 | + 'maps_error_accepts_only' => 'Die parameter $1 kan slegs die volgende {{PLURAL:$3|waarde|waardes}} hê: $2.',
|
| 60 | +);
|
| 61 | +
|
| 62 | +/** Belarusian (Taraškievica orthography) (Беларуская (тарашкевіца))
|
| 63 | + * @author EugeneZelenko
|
| 64 | + * @author Jim-by
|
| 65 | + */
|
| 66 | +$messages['be-tarask'] = array(
|
| 67 | + 'validator_name' => 'Правяраючы',
|
| 68 | + 'validator-desc' => 'Правяраючы палягчае іншым пашырэньням працу па праверцы парамэтраў функцыяў парсэру і тэгаў пашырэньняў, устанаўлівае значэньні па змоўчваньні і стварае паведамленьні пра памылкі',
|
| 69 | + 'validator_error_parameters' => 'У сынтаксісе {{PLURAL:$1|выяўленая наступная памылка|выяўленыя наступныя памылкі}}',
|
| 70 | + 'validator_error_unknown_argument' => 'Няслушны парамэтар $1.',
|
| 71 | + 'validator_error_invalid_argument' => 'Значэньне $1 не зьяўляецца слушным для парамэтру $2.',
|
| 72 | + 'validator_error_empty_argument' => 'Парамэтар $1 ня можа мець пустое значэньне.',
|
| 73 | + 'validator_error_required_missing' => 'Не пададзены абавязковы парамэтар $1.',
|
| 74 | + 'validator_error_must_be_number' => 'Парамэтар $1 можа быць толькі лікам.',
|
| 75 | + 'validator_error_must_be_integer' => 'Парамэтар $1 можа быць толькі цэлым лікам.',
|
| 76 | + 'validator_error_invalid_range' => 'Парамэтар $1 павінен быць паміж $2 і $3.',
|
| 77 | + 'maps_error_accepts_only' => 'Парамэтар $1 можа мець толькі {{PLURAL:$3|гэтае значэньне|гэтыя значэньні}}: $2.',
|
| 78 | +);
|
| 79 | +
|
| 80 | +/** Breton (Brezhoneg)
|
| 81 | + * @author Fohanno
|
| 82 | + * @author Fulup
|
| 83 | + * @author Y-M D
|
| 84 | + */
|
| 85 | +$messages['br'] = array(
|
| 86 | + 'validator_name' => 'Kadarnataer',
|
| 87 | + 'validator_error_parameters' => 'Kavet eo bet ar fazioù da-heul en o ereadur',
|
| 88 | + 'validator_error_invalid_argument' => "N'eo ket reizh an dalvoudenn $1 evit an arventenn $2.",
|
| 89 | + 'validator_error_empty_argument' => "N'hall ket an arventenn $1 bezañ goullo he zalvoudenn",
|
| 90 | + 'validator_error_required_missing' => "N'eo ket bet pourchaset an arventenn rekis $1",
|
| 91 | + 'validator_error_must_be_number' => 'Un niver e rank an arventenn $1 bezañ hepken.',
|
| 92 | + 'validator_error_invalid_range' => 'Rankout a ra an arventenn $1 bezañ etre $2 hag $3.',
|
| 93 | +);
|
| 94 | +
|
| 95 | +/** Bosnian (Bosanski)
|
| 96 | + * @author CERminator
|
| 97 | + */
|
| 98 | +$messages['bs'] = array(
|
| 99 | + 'validator_name' => 'Validator',
|
| 100 | + 'validator-desc' => 'Validator pruža jednostavni način za druga proširenja u svrhu validacije parametara parserskih funkcija i proširenja oznaka, postavlja pretpostavljene vrijednosti i generira poruke pogrešaka.',
|
| 101 | + 'validator_error_parameters' => 'U Vašoj sintaksi {{PLURAL:$1|je|su}} {{PLURAL:$1|otkivena slijedeća greška|otkrivene slijedeće greške}}',
|
| 102 | + 'validator_error_unknown_argument' => '$1 nije valjan parametar.',
|
| 103 | + 'validator_error_invalid_argument' => 'Vrijednost $1 nije valjana za parametar $2.',
|
| 104 | + 'validator_error_empty_argument' => 'Parametar $1 ne može imati praznu vrijednost.',
|
| 105 | + 'validator_error_required_missing' => 'Obavezni parametar $1 nije naveden.',
|
| 106 | + 'validator_error_must_be_number' => 'Parametar $1 može biti samo broj.',
|
| 107 | + 'validator_error_must_be_integer' => 'Parametar $1 može biti samo cijeli broj.',
|
| 108 | + 'validator_error_invalid_range' => 'Parametar $1 mora biti između $2 i $3.',
|
| 109 | + 'maps_error_accepts_only' => 'Parametar $1 se može koristiti samo sa {{PLURAL:$3|ovom vrijednosti|ovim vrijednostima}}: $2.',
|
| 110 | +);
|
| 111 | +
|
| 112 | +/** Lower Sorbian (Dolnoserbski)
|
| 113 | + * @author Michawiki
|
| 114 | + */
|
| 115 | +$messages['dsb'] = array(
|
| 116 | + 'validator_name' => 'Validator',
|
| 117 | + 'validator-desc' => 'Validator stoj lažki nałog za druge rozšyrjenja k dispoziciji, aby se pśekontrolěrowali parametry parserowych funkcijow a toflickich rozšyrjenjow, nastajili standardne gódnoty a napórali zmólkowe powěsći',
|
| 118 | + 'validator_error_parameters' => '{{PLURAL:$1|Slědujuca zmólka jo se namakała|Slědujucej zmólce stej se namakałej|Slědujuce zmólki su se namakali|Slědujuce zmólki su se namakali}} w twójej syntaksy:',
|
| 119 | + 'validator_error_unknown_argument' => '$1 njejo płaśiwy parameter.',
|
| 120 | + 'validator_error_invalid_argument' => 'Gódnota $1 njejo płaśiwa za parameter $2.',
|
| 121 | + 'validator_error_empty_argument' => 'Parameter $1 njamóžo proznu gódnotu měś.',
|
| 122 | + 'validator_error_required_missing' => 'Trěbny parameter $1 njejo pódany.',
|
| 123 | + 'validator_error_must_be_number' => 'Parameter $1 móžo jano licba byś.',
|
| 124 | + 'validator_error_must_be_integer' => 'Parameter $1 móžo jano ceła licba byś.',
|
| 125 | + 'validator_error_invalid_range' => 'Parameter $1 musy mjazy $2 a $3 byś.',
|
| 126 | + 'maps_error_accepts_only' => 'Parameter $1 akceptěrujo jano {{PLURAL:$3|toś tu gódnotu|toś tej gódnośe|toś te gódnoty|toś te gódnoty}}: $2.',
|
| 127 | +);
|
| 128 | +
|
| 129 | +/** Spanish (Español)
|
| 130 | + * @author Crazymadlover
|
| 131 | + * @author Translationista
|
| 132 | + */
|
| 133 | +$messages['es'] = array(
|
| 134 | + 'validator_error_empty_argument' => 'El parámetro $1 no puede tener un valor vacío.',
|
| 135 | + 'validator_error_required_missing' => 'No se ha provisto el parámetro requerido $1.',
|
| 136 | +
|
| 137 | + 'validator_error_must_be_number' => 'El parámetro $1 sólo puede ser un número.',
|
| 138 | + 'validator_error_invalid_range' => 'El parámetro $1 debe ser entre $2 y $3.',
|
| 139 | +);
|
| 140 | +
|
| 141 | +/** French (Français)
|
| 142 | + * @author Crochet.david
|
| 143 | + * @author IAlex
|
| 144 | + * @author Jean-Frédéric
|
| 145 | + * @author McDutchie
|
| 146 | + * @author PieRRoMaN
|
| 147 | + * @author Verdy p
|
| 148 | + */
|
| 149 | +$messages['fr'] = array(
|
| 150 | + 'validator_name' => 'Validateur',
|
| 151 | + 'validator-desc' => "Le validateur fournit un moyen simple aux autres extensions de valider les paramètres des fonctions parseur et des extensions de balises, de définir des valeurs par défaut et de générer des messages d'erreur",
|
| 152 | + 'validator_error_parameters' => '{{PLURAL:$1|L’erreur suivante a été détectée|Les erreurs suivantes ont été détectées}} dans votre syntaxe',
|
| 153 | + 'validator_error_unknown_argument' => '$1 n’est pas un paramètre valide.',
|
| 154 | + 'validator_error_invalid_argument' => "La valeur $1 n'est pas valide pour le paramètre $2.",
|
| 155 | + 'validator_error_empty_argument' => 'Le paramètre $1 ne peut pas avoir une valeur vide.',
|
| 156 | + 'validator_error_required_missing' => "Le paramètre requis $1 n'est pas fourni.",
|
| 157 | + 'validator_error_must_be_number' => 'Le paramètre $1 peut être uniquement un nombre.',
|
| 158 | + 'validator_error_must_be_integer' => 'Le paramètre $1 peut seulement être un entier.',
|
| 159 | + 'validator_error_invalid_range' => 'Le paramètre $1 doit être entre $2 et $3.',
|
| 160 | + 'maps_error_accepts_only' => 'Le paramètre $1 accepte uniquement {{PLURAL:$3|cette valeur|ces valeurs}} : $2.',
|
| 161 | +);
|
| 162 | +
|
| 163 | +/** Galician (Galego)
|
| 164 | + * @author Toliño
|
| 165 | + */
|
| 166 | +$messages['gl'] = array(
|
| 167 | + 'validator_name' => 'Servizo de validación',
|
| 168 | + 'validator-desc' => 'O servizo de validación ofrece un medio sinxelo a outras extensións para validar os parámetros de funcións analíticas e etiquetas de extensións, para establecer os valores por defecto e para xerar mensaxes de erro',
|
| 169 | + 'validator_error_parameters' => '{{PLURAL:$1|Detectouse o seguinte erro|Detectáronse os seguintes erros}} na sintaxe empregada',
|
| 170 | + 'validator_error_unknown_argument' => '"$1" non é un parámetro válido.',
|
| 171 | + 'validator_error_invalid_argument' => 'O valor $1 non é válido para o parámetro $2.',
|
| 172 | + 'validator_error_empty_argument' => 'O parámetro $1 non pode ter un valor baleiro.',
|
| 173 | + 'validator_error_required_missing' => 'Non se proporcionou o parámetro $1 necesario.',
|
| 174 | + 'validator_error_must_be_number' => 'O parámetro $1 só pode ser un número.',
|
| 175 | + 'validator_error_must_be_integer' => 'O parámetro $1 só pode ser un número enteiro.',
|
| 176 | + 'validator_error_invalid_range' => 'O parámetro $1 debe estar entre $2 e $3.',
|
| 177 | + 'maps_error_accepts_only' => 'O parámetro "$1" só acepta {{PLURAL:$3|este valor|estes valores}}: $2.',
|
| 178 | +);
|
| 179 | +
|
| 180 | +/** Swiss German (Alemannisch)
|
| 181 | + * @author Als-Holder
|
| 182 | + */
|
| 183 | +$messages['gsw'] = array(
|
| 184 | + 'validator_name' => 'Validator',
|
| 185 | + 'validator-desc' => 'Validator stellt e eifachi Form z Verfiegig fir anderi Erwyterige go Parameter validiere vu Parser- un Tag-Funktione, go Standardwärt definiere un Fählermäldige generiere',
|
| 186 | + 'validator_error_parameters' => '{{PLURAL:$1|Dää Fähler isch|Die Fähler sin}} in Dyyre Syntax gfunde wore',
|
| 187 | + 'validator_error_unknown_argument' => '$1 isch kei giltige Parameter.',
|
| 188 | + 'validator_error_invalid_argument' => 'Dr Wärt $1 isch nit giltig fir dr Parameter $2.',
|
| 189 | + 'validator_error_empty_argument' => 'Dr Parameter $1 cha kei lääre Wärt haa.',
|
| 190 | + 'validator_error_required_missing' => 'Dr Paramter $1, wu aagforderet woren isch, wird nit z Verfiegig gstellt.',
|
| 191 | + 'validator_error_must_be_number' => 'Dr Parameter $1 cha nume ne Zahl syy.',
|
| 192 | + 'validator_error_must_be_integer' => 'Parameter $1 cha nume ne giltigi Zahl syy.',
|
| 193 | + 'validator_error_invalid_range' => 'Dr Parameter $1 muess zwische $2 un $3 syy.',
|
| 194 | + 'maps_error_accepts_only' => 'Dr Parameter $1 cha nume {{PLURAL:$3|dää Wärt|die Wärt}} haa: $2.',
|
| 195 | +);
|
| 196 | +
|
| 197 | +/** Upper Sorbian (Hornjoserbsce)
|
| 198 | + * @author Michawiki
|
| 199 | + */
|
| 200 | +$messages['hsb'] = array(
|
| 201 | + 'validator_name' => 'Validator',
|
| 202 | + 'validator-desc' => 'Validator skići lochke wašnje za druhe rozšěrjenja, zo bychu so parametry parserowych funkcijow a tafličkowych rozšěrjenjow přepruwowali, standardne hódnoty nastajili a zmylkowe powěsće wutworili',
|
| 203 | + 'validator_error_parameters' => '{{PLURAL:$1|Slědowacy zmylk bu|Slědowacej zmylkaj buštej|Slědowace zmylki buchu|Slědowace zmylki buchu}} w twojej syntaksy {{PLURAL:$1|wotkryty|wotkrytej|wotkryte|wotkryte}}:',
|
| 204 | + 'validator_error_unknown_argument' => '$1 płaćiwy parameter njeje.',
|
| 205 | + 'validator_error_invalid_argument' => 'Hódnota $1 njeje płaćiwa za parameter $2.',
|
| 206 | + 'validator_error_empty_argument' => 'Parameter $1 njemóže prózdnu hódnotu měć.',
|
| 207 | + 'validator_error_required_missing' => 'Trěbny parameter $1 njeje podaty.',
|
| 208 | + 'validator_error_must_be_number' => 'Parameter $1 móže jenož ličba być.',
|
| 209 | + 'validator_error_must_be_integer' => 'Parameter $1 móže jenož cyła ličba być.',
|
| 210 | + 'validator_error_invalid_range' => 'Parameter $1 dyrbi mjez $2 a $3 być.',
|
| 211 | + 'maps_error_accepts_only' => 'Parameter $1 akceptuje jenož {{PLURAL:$3|tutu hódnotu|tutej hódnoće|tute hódnoty|tute hódnoty}}: $2.',
|
| 212 | +);
|
| 213 | +
|
| 214 | +/** Hungarian (Magyar)
|
| 215 | + * @author Dani
|
| 216 | + * @author Glanthor Reviol
|
| 217 | + */
|
| 218 | +$messages['hu'] = array(
|
| 219 | + 'validator_name' => 'Érvényesség-ellenőrző',
|
| 220 | + 'validator-desc' => 'Az érvényesség-ellenőrző egyszerű lehetőséget nyújt más kiterjesztéseknek az elemzőfüggvények és tagek paramétereinek ellenőrzésére, alapértelmezett értékek beállítására, valamint hibaüzenetek generálására.',
|
| 221 | + 'validator_error_parameters' => 'A következő {{PLURAL:$1|hiba található|hibák találhatóak}} a szintaxisban: $1',
|
| 222 | + 'validator_error_unknown_argument' => 'A(z) $1 nem érvényes paraméter.',
|
| 223 | + 'validator_error_invalid_argument' => 'A(z) $1 érték nem érvényes a(z) $2 paraméterhez.',
|
| 224 | + 'validator_error_empty_argument' => 'A(z) $1 paraméter értéke nem lehet üres.',
|
| 225 | + 'validator_error_required_missing' => 'A(z) $1 kötelező paraméter nem lett megadva.',
|
| 226 | + 'validator_error_must_be_number' => 'A(z) $1 paraméter csak szám lehet.',
|
| 227 | + 'validator_error_invalid_range' => 'A(z) $1 paraméter értékének $2 és $3 között kell lennie.',
|
| 228 | + 'maps_error_accepts_only' => 'A(z) $1 paraméter csak a következő {{PLURAL:$3|értéket|értékeket}} fogadja el: $2',
|
| 229 | +);
|
| 230 | +
|
| 231 | +/** Interlingua (Interlingua)
|
| 232 | + * @author McDutchie
|
| 233 | + */
|
| 234 | +$messages['ia'] = array(
|
| 235 | + 'validator_name' => 'Validator',
|
| 236 | + 'validator-desc' => 'Validator provide un modo facile a altere extensiones de validar parametros de functiones del analysator syntactic e extensiones de etiquettas, predefinir valores e generar messages de error',
|
| 237 | + 'validator_error_parameters' => 'Le sequente {{PLURAL:$1|error|errores}} ha essite detegite in tu syntaxe',
|
| 238 | + 'validator_error_unknown_argument' => '$1 non es un parametro valide.',
|
| 239 | + 'validator_error_invalid_argument' => 'Le valor $1 non es valide pro le parametro $2.',
|
| 240 | + 'validator_error_empty_argument' => 'Le parametro $1 non pote haber un valor vacue.',
|
| 241 | + 'validator_error_required_missing' => 'Le parametro requisite $1 non ha essite fornite.',
|
| 242 | + 'validator_error_must_be_number' => 'Le parametro $1 pote solmente esser un numero.',
|
| 243 | + 'validator_error_must_be_integer' => 'Le parametro $1 pote solmente esser un numero integre.',
|
| 244 | + 'validator_error_invalid_range' => 'Le parametro $1 debe esser inter $2 e $3.',
|
| 245 | + 'maps_error_accepts_only' => 'Le parametro $1 accepta solmente iste {{PLURAL:$3|valor|valores}}: $2.',
|
| 246 | +);
|
| 247 | +
|
| 248 | +/** Indonesian (Bahasa Indonesia)
|
| 249 | + * @author Bennylin
|
| 250 | + * @author Farras
|
| 251 | + * @author Irwangatot
|
| 252 | + * @author IvanLanin
|
| 253 | + */
|
| 254 | +$messages['id'] = array(
|
| 255 | + 'validator_name' => 'Validator',
|
| 256 | + 'validator-desc' => 'Validator memberikan cara mudah untuk ekstensi lain untuk memvalidasi parameter ParserFunction dan ekstensi tag, mengatur nilai biasa dan membuat pesan kesalahan',
|
| 257 | + 'validator_error_parameters' => '{{PLURAL:$1|Kesalahan|Kesalahan}} berikut telah terdeteksi pada sintaksis Anda',
|
| 258 | + 'validator_error_unknown_argument' => '$1 bukan parameter yang benar.',
|
| 259 | + 'validator_error_invalid_argument' => 'Nilai $1 tidak valid untuk parameter $2.',
|
| 260 | + 'validator_error_empty_argument' => 'Parameter $1 tidak dapat bernilai kosong.',
|
| 261 | + 'validator_error_required_missing' => 'Parameter $1 yang diperlukan tidak diberikan.',
|
| 262 | + 'validator_error_must_be_number' => 'Parameter $1 hanya dapat berupa angka.',
|
| 263 | + 'validator_error_must_be_integer' => 'Parameter $1 hanya dapat berupa integer.',
|
| 264 | + 'validator_error_invalid_range' => 'Parameter $1 harus antara $2 dan $3.',
|
| 265 | + 'maps_error_accepts_only' => 'Parameter $1 hanya menerima {{PLURAL:$3|nilai ini|nilai ini}}: $2.',
|
| 266 | +);
|
| 267 | +
|
| 268 | +/** Japanese (日本語)
|
| 269 | + * @author Aotake
|
| 270 | + * @author Fryed-peach
|
| 271 | + */
|
| 272 | +$messages['ja'] = array(
|
| 273 | + 'validator_name' => '妥当性評価器',
|
| 274 | + 'validator-desc' => '妥当性評価器は他の拡張機能にパーサー関数やタグ拡張の引数の妥当性を確認したり、規定値を設定したり、エラーメッセージを生成する手段を提供する',
|
| 275 | + 'validator_error_parameters' => 'あなたの入力から以下の{{PLURAL:$1|エラー}}が検出されました',
|
| 276 | + 'validator_error_unknown_argument' => '$1 は有効な引数ではありません。',
|
| 277 | + 'validator_error_invalid_argument' => '値「$1」は引数「$2」として妥当ではありません。',
|
| 278 | + 'validator_error_empty_argument' => '引数「$1」は空の値をとることができません。',
|
| 279 | + 'validator_error_required_missing' => '必須の引数「$1」が入力されていません。',
|
| 280 | + 'validator_error_must_be_number' => '引数「$1」は数値でなければなりません。',
|
| 281 | + 'validator_error_must_be_integer' => '引数「$1」は整数でなければなりません。',
|
| 282 | + 'validator_error_invalid_range' => '引数「$1」は $2 と $3 の間の値でなければなりません。',
|
| 283 | + 'maps_error_accepts_only' => '引数 $1 は次の{{PLURAL:$3|値}}以外を取ることはできません: $2',
|
| 284 | +);
|
| 285 | +
|
| 286 | +/** Ripoarisch (Ripoarisch)
|
| 287 | + * @author Purodha
|
| 288 | + */
|
| 289 | +$messages['ksh'] = array(
|
| 290 | + 'validator_name' => 'Prööver',
|
| 291 | + 'validator-desc' => '{{int:validator_name}} brängk eine eijfache Wääsch, der Parrammeetere fun Paaser-Fungkßjohne un Zohsatzprojramme ze prööve, Schtandatt-Wääte enzefööje, un Fähler ze mällde.',
|
| 292 | + 'validator_error_parameters' => '{{PLURAL:$1|Heh dä|Heh di|Keine}} Fähler {{PLURAL:$1|es|sin|es}} en Dinge Syntax opjevalle:',
|
| 293 | + 'validator_error_unknown_argument' => '„$1“ es keine jöltijje Parameeter.',
|
| 294 | + 'validator_error_invalid_argument' => 'Däm Parameeter $2 singe Wäät es $1, dat es ävver doför nit jöltesch.',
|
| 295 | + 'validator_error_empty_argument' => 'Dä Parameeter $1 kann keine Wäät met nix dren hann.',
|
| 296 | + 'validator_error_required_missing' => 'Dä Parameeter $1 moß aanjejovve sin, un fählt.',
|
| 297 | + 'validator_error_must_be_number' => 'Dä Parameeter $1 kann blohß en Zahl sin.',
|
| 298 | + 'validator_error_must_be_integer' => 'Dä Parrameeter $1 kann bloß en jannze Zahl sin.',
|
| 299 | + 'validator_error_invalid_range' => 'Dä Parameeter $1 moß zwesche $2 un $3 sin.',
|
| 300 | + 'maps_error_accepts_only' => 'Dä Parameeter $1 kann {{PLURAL:$3|bloß dä eine Wäät|bloß eine vun dä Wääte|keine Wäät}} han: $2',
|
| 301 | +);
|
| 302 | +
|
| 303 | +/** Luxembourgish (Lëtzebuergesch)
|
| 304 | + * @author Robby
|
| 305 | + */
|
| 306 | +$messages['lb'] = array(
|
| 307 | + 'validator_name' => 'Validator',
|
| 308 | + 'validator-desc' => 'Validator erlaabt et op eng einfach Manéier fir Parameter vu Parser-Fonctiounen an Tag-Erweiderungen ze validéieren, fir Standard-Werter festzeleeën a fir Feeler-Messagen ze generéieren',
|
| 309 | + 'validator_error_parameters' => '{{PLURAL:$1|Dëser Feeler gouf|Dës Feeler goufen}} an Ärer Syntax fonnt.',
|
| 310 | + 'validator_error_unknown_argument' => '$1 ass kee valbele Parameter.',
|
| 311 | + 'validator_error_invalid_argument' => 'De Wert $1 ass net valabel fir de Parameter $2.',
|
| 312 | + 'validator_error_empty_argument' => 'De Parameter $1 ka keen eidele Wert hunn.',
|
| 313 | + 'validator_error_required_missing' => 'Den obligatoresche Parameter $1 war net derbäi.',
|
| 314 | + 'validator_error_must_be_number' => 'De Parameter $1 ka just eng Zuel sinn',
|
| 315 | + 'validator_error_invalid_range' => 'De Parameter $1 muss tëschent $2 an $3 leien.',
|
| 316 | + 'maps_error_accepts_only' => 'De Parameter $1 akzeptéiert just {{PLURAL:$3|dëse Wert|dës Werter}}: $2',
|
| 317 | +);
|
| 318 | +
|
| 319 | +/** Macedonian (Македонски)
|
| 320 | + * @author Bjankuloski06
|
| 321 | + * @author McDutchie
|
| 322 | + */
|
| 323 | +$messages['mk'] = array(
|
| 324 | + 'validator_name' => 'Потврдувач',
|
| 325 | + 'validator-desc' => 'Потврдувачот овозможува лесен начин другите проширувања да ги потврдат параметрите на парсерските функции и проширувањата со ознаки, да поставаат основно зададени вредности и да создаваат пораки за грешки',
|
| 326 | + 'validator_error_parameters' => 'Во вашата синтакса {{PLURAL:$1|е откриена следнава грешка|се откриени следниве грешки}}',
|
| 327 | + 'validator_error_unknown_argument' => '$1 не е важечки параметар.',
|
| 328 | + 'validator_error_invalid_argument' => 'Вредноста $1 е неважечка за параметарот $2.',
|
| 329 | + 'validator_error_empty_argument' => 'Параметарот $1 не може да има празна вредност.',
|
| 330 | + 'validator_error_required_missing' => 'Бараниот параметар $1 не е наведен.',
|
| 331 | + 'validator_error_must_be_number' => 'Параметарот $1 може да биде само број.',
|
| 332 | + 'validator_error_must_be_integer' => 'Параметарот $1 може да биде само цел број.',
|
| 333 | + 'validator_error_invalid_range' => 'Параметарот $1 мора да изнесува помеѓу $2 и $3.',
|
| 334 | + 'maps_error_accepts_only' => 'Параметарот $1 {{PLURAL:$3|ја прифаќа само оваа вредност|ги прифаќа само овие вредности}}: $2.',
|
| 335 | +);
|
| 336 | +
|
| 337 | +/** Dutch (Nederlands)
|
| 338 | + * @author Jeroen De Dauw
|
| 339 | + * @author Siebrand
|
| 340 | + */
|
| 341 | +$messages['nl'] = array(
|
| 342 | + 'validator_name' => 'Validator',
|
| 343 | + 'validator-desc' => 'Validator geeft andere uitbreidingen de mogelijkheid om parameters van parserfuncties en taguitbreidingen te valideren, in te stellen op hun standaardwaarden en foutberichten te genereren',
|
| 344 | + 'validator_error_parameters' => 'In uw syntaxis {{PLURAL:$1|is de volgende fout|zijn de volgende fouten}} gedetecteerd',
|
| 345 | + 'validator_error_unknown_argument' => '$1 is geen geldige parameter.',
|
| 346 | + 'validator_error_invalid_argument' => 'De waarde $1 is niet geldig voor de parameter $2.',
|
| 347 | + 'validator_error_empty_argument' => 'De parameter $1 mag niet leeg zijn.',
|
| 348 | + 'validator_error_required_missing' => 'De verplichte parameter $1 is niet opgegeven.',
|
| 349 | + 'validator_error_must_be_number' => 'De parameter $1 mag alleen een getal zijn.',
|
| 350 | + 'validator_error_must_be_integer' => 'De parameter $1 kan alleen een heel getal zijn.',
|
| 351 | + 'validator_error_invalid_range' => 'De parameter $1 moet tussen $2 en $3 liggen.',
|
| 352 | + 'maps_error_accepts_only' => 'De parameter $1 kan alleen de volgende {{PLURAL:$3|waarde|waarden}} hebben: $2.',
|
| 353 | +);
|
| 354 | +
|
| 355 | +/** Piedmontese (Piemontèis)
|
| 356 | + * @author Borichèt
|
| 357 | + * @author Dragonòt
|
| 358 | + * @author McDutchie
|
| 359 | + */
|
| 360 | +$messages['pms'] = array(
|
| 361 | + 'validator_name' => 'Validator',
|
| 362 | + 'validator-desc' => "Validator a dà na manera bel fé për àutre estension ëd validé ij paràmetr ëd le funsion dël parser e j'estension dij tag, d'amposté ij valor ëd default e generé mëssagi d'eror",
|
| 363 | + 'validator_error_parameters' => "{{PLURAL:$1|L'eror sota a l'é stàit|J'eror sota a son ëstàit}} trovà an toa sintassi",
|
| 364 | + 'validator_error_unknown_argument' => "$1 a l'é un paràmetr pa bon.",
|
| 365 | + 'validator_error_invalid_argument' => "Ël valor $1 a l'é pa bon për ël paràmetr $2.",
|
| 366 | + 'validator_error_empty_argument' => 'Ël paràmetr $1 a peul pa avèj un valor veuid.',
|
| 367 | + 'validator_error_required_missing' => "Ël paràmetr obligatòri $1 a l'é pa dàit.",
|
| 368 | + 'validator_error_must_be_number' => 'Ël paràmetr $1 a peul mach esse un nùmer.',
|
| 369 | + 'validator_error_must_be_integer' => "Ël paràmetr $1 a peul mach esse n'antregh.",
|
| 370 | + 'validator_error_invalid_range' => 'Ël paràmetr $1 a deuv esse an tra $2 e $3.',
|
| 371 | + 'maps_error_accepts_only' => 'Ël paràmetr $1 a aceta mach {{PLURAL:$3|sto valor-sì|sti valor-sì}}: $2.',
|
| 372 | +);
|
| 373 | +
|
| 374 | +/** Portuguese (Português)
|
| 375 | + * @author Hamilton Abreu
|
| 376 | + */
|
| 377 | +$messages['pt'] = array(
|
| 378 | + 'validator_name' => 'Serviço de Validação',
|
| 379 | + 'validator-desc' => 'O Serviço de Validação permite que, de forma simples, as outras extensões possam validar parâmetros das funções do analisador sintáctico e das extensões dos elementos HTML, definir valores por omissão e gerar mensagens de erro',
|
| 380 | + 'validator_error_parameters' => '{{PLURAL:$1|Foi detectado o seguinte erro sintáctico|Foram detectados os seguintes erros sintácticos}}',
|
| 381 | + 'validator_error_unknown_argument' => '$1 não é um parâmetro válido.',
|
| 382 | + 'validator_error_invalid_argument' => 'O valor $1 não é válido para o parâmetro $2.',
|
| 383 | + 'validator_error_empty_argument' => 'O parâmetro $1 não pode estar vazio.',
|
| 384 | + 'validator_error_required_missing' => 'O parâmetro obrigatório $1 não foi fornecido.',
|
| 385 | + 'validator_error_must_be_number' => 'O parâmetro $1 só pode ser numérico.',
|
| 386 | + 'validator_error_must_be_integer' => 'O parâmetro $1 só pode ser um número inteiro.',
|
| 387 | + 'validator_error_invalid_range' => 'O parâmetro $1 tem de ser entre $2 e $3.',
|
| 388 | + 'maps_error_accepts_only' => 'O parâmetro $1 só aceita {{PLURAL:$3|este valor|estes valores}}: $2.',
|
| 389 | +);
|
| 390 | +
|
| 391 | +/** Russian (Русский)
|
| 392 | + * @author Lockal
|
| 393 | + * @author McDutchie
|
| 394 | + * @author Александр Сигачёв
|
| 395 | + */
|
| 396 | +$messages['ru'] = array(
|
| 397 | + 'validator_name' => 'Валидатор',
|
| 398 | + 'validator-desc' => 'Валидатор предоставляет другим расширениям возможности проверки параметров функций парсера и тегов, установки значения по умолчанию и создания сообщения об ошибках',
|
| 399 | + 'validator_error_parameters' => 'В вашем синтаксисе {{PLURAL:$1|обнаружена следующая ошибка|обнаружены следующие ошибки}}',
|
| 400 | + 'validator_error_unknown_argument' => '$1 не является допустимым параметром.',
|
| 401 | + 'validator_error_invalid_argument' => 'Значение $1 не является допустимым параметром $2',
|
| 402 | + 'validator_error_empty_argument' => 'Параметр $1 не может принимать пустое значение.',
|
| 403 | + 'validator_error_required_missing' => 'Не указан обязательный параметр $1.',
|
| 404 | + 'validator_error_must_be_number' => 'Значением параметра $1 могут быть только числа.',
|
| 405 | + 'validator_error_must_be_integer' => 'Параметр $1 может быть только целым числом.',
|
| 406 | + 'validator_error_invalid_range' => 'Параметр $1 должен быть от $2 до $3.',
|
| 407 | + 'maps_error_accepts_only' => 'Параметр $1 может принимать только {{PLURAL:$3|следующее значение|следующие значения}}: $2.',
|
| 408 | +);
|
| 409 | +
|
| 410 | +/** Sinhala (සිංහල)
|
| 411 | + * @author Calcey
|
| 412 | + */
|
| 413 | +$messages['si'] = array(
|
| 414 | + 'validator_name' => 'තහවුරු කරන්නා',
|
| 415 | + 'validator-desc' => 'තහවුරු කරන්නා ටැග් දිඟුවන් හා parser ශ්රිතවල පරාමිතීන් තහවුරු කිරීමට අනෙක් දිඟුවන් සඳහා පහසු ක්රමයක් සපයයි,පෙරනිමි අගයන් පිහිටුවීම හා දෝෂ පණිවුඩ ජනනය කිරීම ද සිදු කරයි',
|
| 416 | + 'validator_error_parameters' => 'ඔබේ වාග් රීතිය මඟින් පහත {{PLURAL:$1|දෝෂය|දෝෂයන්}} අනාවරණය කරනු ලැබ ඇත',
|
| 417 | + 'validator_error_unknown_argument' => '$1 වලංගු පරාමිතියක් නොවේ.',
|
| 418 | + 'validator_error_invalid_argument' => '$2 පරාමිතිය සඳහා $1 අගය වලංගු නොවේ.',
|
| 419 | + 'validator_error_empty_argument' => '$1 පරාමිතියට හිස් අගයක් තිබිය නොහැක.',
|
| 420 | + 'validator_error_required_missing' => 'අවශ්ය වන $1 පරාමිතිය සපයා නොමැත.',
|
| 421 | + 'validator_error_must_be_number' => '$1 පරාමිතිය විය හැක්කේ ඉලක්කමක් පමණි.',
|
| 422 | + 'validator_error_invalid_range' => '$1 පරාමිතිය $2 හා $3 අතර විය යුතුය.',
|
| 423 | + 'maps_error_accepts_only' => '$1 පරාමිතිය විසින් පිළිගනු ලබන්නේ {{PLURAL:$3|මෙම අගය|මෙම අගයන්}}: $2 පමණි.',
|
| 424 | +);
|
| 425 | +
|
| 426 | +/** Swedish (Svenska)
|
| 427 | + * @author Fluff
|
| 428 | + * @author Per
|
| 429 | + */
|
| 430 | +$messages['sv'] = array(
|
| 431 | + 'validator_error_parameters' => 'Följande fel har upptäckts i din syntax',
|
| 432 | + 'validator_error_invalid_argument' => 'Värdet $1 är inte giltigt som parameter $2.',
|
| 433 | + 'validator_error_empty_argument' => 'Parametern $1 kan inte lämnas tom.',
|
| 434 | + 'validator_error_required_missing' => 'Den nödvändiga parametern $1 har inte angivits.',
|
| 435 | + 'validator_error_must_be_number' => 'Parameter $1 måste bestå av ett tal.',
|
| 436 | + 'validator_error_invalid_range' => 'Parameter $1 måste vara i mellan $2 och $3.',
|
| 437 | +);
|
| 438 | +
|
| 439 | +/** Ukrainian (Українська)
|
| 440 | + * @author Prima klasy4na
|
| 441 | + */
|
| 442 | +$messages['uk'] = array(
|
| 443 | + 'validator_name' => 'Валідатор',
|
| 444 | + 'validator-desc' => 'Валідатор забезпечує іншим розширенням можливості перевірки параметрів функцій парсеру і тегів, встановлення значень за замовчуванням та створення повідомлень про помилки',
|
| 445 | + 'validator_error_parameters' => 'У вашому синтаксисі {{PLURAL:$1|виявлена наступна помилка|виявлені наступні помилки}}',
|
| 446 | +);
|
| 447 | +
|
| 448 | +/** Vietnamese (Tiếng Việt)
|
| 449 | + * @author Minh Nguyen
|
| 450 | + * @author Vinhtantran
|
| 451 | + */
|
| 452 | +$messages['vi'] = array(
|
| 453 | + 'validator_name' => 'Bộ phê chuẩn',
|
| 454 | + 'validator-desc' => 'Bộ phê chuẩn cho phép các phần mở rộng khác phê chuẩn tham số của hàm cú pháp và thẻ mở rộng, đặt giá trị mặc định, và báo cáo lỗi.',
|
| 455 | + 'validator_error_parameters' => 'Cú pháp có {{PLURAL:$1|lỗi|các lỗi}} sau',
|
| 456 | + 'validator_error_unknown_argument' => '$1 không phải là tham số hợp lệ.',
|
| 457 | + 'validator_error_invalid_argument' => 'Giá trị “$1” không hợp tham số “$2”.',
|
| 458 | + 'validator_error_empty_argument' => 'Tham số “$1” không được để trống.',
|
| 459 | + 'validator_error_required_missing' => 'Không định rõ tham số bắt buộc “$1”.',
|
| 460 | + 'validator_error_must_be_number' => 'Tham số “$1” phải là con số.',
|
| 461 | + 'validator_error_invalid_range' => 'Tham số “$1” phải nằm giữa $2 và $3.',
|
| 462 | + 'maps_error_accepts_only' => 'Tham số $1 chỉ nhận được {{PLURAL:$3|giá trị|các giá trị}} này: $2.',
|
| 463 | +);
|
| 464 | +
|
Index: tags/extensions/Validator/REL_0_1/Validator.php |
— | — | @@ -0,0 +1,68 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * Initialization file for the Validator extension.
|
| 6 | + * Extension documentation: http://www.mediawiki.org/wiki/Extension:Validator
|
| 7 | + *
|
| 8 | + * You will be validated. Resistance is futile.
|
| 9 | + *
|
| 10 | + * @file Validator.php
|
| 11 | + * @ingroup Validator
|
| 12 | + *
|
| 13 | + * @author Jeroen De Dauw
|
| 14 | + */
|
| 15 | +
|
| 16 | +/**
|
| 17 | + * This documenation group collects source code files belonging to Validator.
|
| 18 | + *
|
| 19 | + * Please do not use this group name for other code.
|
| 20 | + *
|
| 21 | + * @defgroup Validator Validator
|
| 22 | + */
|
| 23 | +
|
| 24 | +if ( !defined( 'MEDIAWIKI' ) ) {
|
| 25 | + die( 'Not an entry point.' );
|
| 26 | +}
|
| 27 | +
|
| 28 | +define( 'Validator_VERSION', '0.1' );
|
| 29 | +
|
| 30 | +// Constants indicating the strictness of the parameter validation.
|
| 31 | +define( 'Validator_ERRORS_NONE', 0 );
|
| 32 | +define( 'Validator_ERRORS_WARN', 1 );
|
| 33 | +define( 'Validator_ERRORS_SHOW', 2 );
|
| 34 | +define( 'Validator_ERRORS_STRICT', 3 );
|
| 35 | +
|
| 36 | +$egValidatorIP = $IP . '/extensions/Validator';
|
| 37 | +
|
| 38 | +// Include the settings file.
|
| 39 | +require_once( $egValidatorIP . '/Validator_Settings.php' );
|
| 40 | +
|
| 41 | +// Put the initalization function into the MW extension hook.
|
| 42 | +$wgExtensionFunctions[] = 'efValidatorSetup';
|
| 43 | +
|
| 44 | +// Register the internationalization file.
|
| 45 | +$wgExtensionMessagesFiles['Validator'] = $egValidatorIP . '/Validator.i18n.php';
|
| 46 | +
|
| 47 | +// Autoload the general classes
|
| 48 | +$wgAutoloadClasses['Validator'] = $egValidatorIP . '/Validator.class.php';
|
| 49 | +$wgAutoloadClasses['ValidatorFunctions'] = $egValidatorIP . '/Validator_Functions.php';
|
| 50 | +$wgAutoloadClasses['ValidatorManager'] = $egValidatorIP . '/Validator_Manager.php';
|
| 51 | +
|
| 52 | +/**
|
| 53 | + * Initialization function for the Validator extension.
|
| 54 | + */
|
| 55 | +function efValidatorSetup() {
|
| 56 | + global $wgExtensionCredits;
|
| 57 | +
|
| 58 | + wfLoadExtensionMessages( 'Validator' );
|
| 59 | +
|
| 60 | + $wgExtensionCredits['other'][] = array(
|
| 61 | + 'path' => __FILE__,
|
| 62 | + 'name' => wfMsg( 'validator_name' ),
|
| 63 | + 'version' => Validator_VERSION,
|
| 64 | + 'author' => array( '[http://bn2vs.com Jeroen De Dauw]' ),
|
| 65 | + 'url' => 'http://www.mediawiki.org/wiki/Extension:Validator',
|
| 66 | + 'description' => wfMsg( 'validator-desc' ),
|
| 67 | + 'descriptionmsg' => 'validator-desc',
|
| 68 | + );
|
| 69 | +}
|
Index: tags/extensions/Validator/REL_0_1/Validator_Settings.php |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +<?php
|
| 3 | +
|
| 4 | +/**
|
| 5 | + * File defining the settings for the Validator extension
|
| 6 | + *
|
| 7 | + * NOTICE:
|
| 8 | + * Changing one of these settings can be done by copieng or cutting it,
|
| 9 | + * and placing it in LocalSettings.php, AFTER the inclusion of Validator.
|
| 10 | + *
|
| 11 | + * @file Validator_Settings.php
|
| 12 | + * @ingroup Validator
|
| 13 | + *
|
| 14 | + * @author Jeroen De Dauw
|
| 15 | + */
|
| 16 | +
|
| 17 | +if ( !defined( 'MEDIAWIKI' ) ) {
|
| 18 | + die( 'Not an entry point.' );
|
| 19 | +}
|
| 20 | +
|
| 21 | +# Integer. The strictness of the parameter validation and resulting error report when using the ValidatorManager class.
|
| 22 | +# Validator_ERRORS_NONE : Validator will not show any errors, and make the best of the input it got.
|
| 23 | +# Validator_ERRORS_WARN : Validator will make the best of the input it got, but will show a warning that there are errors.
|
| 24 | +# Validator_ERRORS_SHOW : Validator will make the best of the input it got, but will show a list of all errors.
|
| 25 | +# Validator_ERRORS_STRICT: Validator will only show regular output when there are no errors, if there are, a list of them will be shown.
|
| 26 | +$egValidatorErrorLevel = Validator_ERRORS_SHOW;
|
Index: tags/extensions/Validator/REL_0_1/README |
— | — | @@ -0,0 +1,12 @@ |
| 2 | +== About ==
|
| 3 | +
|
| 4 | +Validator is an extension that makes parameter validation functionality available
|
| 5 | +to other extensions. This enables other extensions to validate parameters, set them
|
| 6 | +to their defaults, and generate error messages, while only defining the parameters
|
| 7 | +and their criteria.
|
| 8 | +
|
| 9 | +Notes on installing Validator are found in the file INSTALL.
|
| 10 | +
|
| 11 | +== Contributors ==
|
| 12 | +
|
| 13 | +http://www.mediawiki.org/wiki/Extension:Validator#Contributing_to_the_project
|