Index: trunk/extensions/Validator/includes/parserHooks/Validator_Describe.php |
— | — | @@ -193,7 +193,7 @@ |
194 | 194 | * @return string |
195 | 195 | */ |
196 | 196 | protected function getSyntaxExamples( $hookName, array $parameters, ParserHook $parserHook ) { |
197 | | - $result = "<h3>Syntax</h3>\n\n"; // TODO: i18n |
| 197 | + $result = '<h3>' . wfMsg( 'validator-describe-syntax' ) . "</h3>\n\n"; |
198 | 198 | |
199 | 199 | $params = array(); |
200 | 200 | |
— | — | @@ -233,22 +233,21 @@ |
234 | 234 | } |
235 | 235 | |
236 | 236 | if ( count( $tableRows ) > 0 ) { // i18n |
237 | | - $tableRows = array_merge( array( '! # |
238 | | -! Parameter |
239 | | -! Aliases |
240 | | -! Type |
241 | | -! Default |
242 | | -! Description' ), $tableRows ); |
| 237 | + $tableRows = array_merge( array( |
| 238 | + "! #\n" . |
| 239 | + '!' . wfMsg( 'validator-describe-parameter' ) ."\n" . |
| 240 | + '!' . wfMsg( 'validator-describe-aliases' ) ."\n" . |
| 241 | + '!' . wfMsg( 'validator-describe-type' ) ."\n" . |
| 242 | + '!' . wfMsg( 'validator-describe-default' ) ."\n" . |
| 243 | + '!' . wfMsg( 'validator-describe-description' ) |
| 244 | + ), $tableRows ); |
243 | 245 | |
244 | 246 | $table = implode( "\n|-\n", $tableRows ); |
245 | 247 | |
246 | | - $table = <<<EOT |
247 | | -<h3>Parameters</h3> |
248 | | - |
249 | | -{| class="wikitable sortable" |
250 | | -{$table} |
251 | | -|} |
252 | | -EOT; |
| 248 | + $table = '<h3>' . wfMsg( 'validator-describe-parameters' ) . '</h3>' . "\n" . |
| 249 | + '{| class="wikitable sortable"' . "\n" . |
| 250 | + $table . |
| 251 | + "\n|}"; |
253 | 252 | } |
254 | 253 | |
255 | 254 | return $table; |
— | — | @@ -268,9 +267,9 @@ |
269 | 268 | $aliases = $parameter->getAliases(); |
270 | 269 | $aliases = count( $aliases ) > 0 ? implode( ', ', $aliases ) : '-'; |
271 | 270 | |
272 | | - $default = $parameter->isRequired() ? "''required''" : $parameter->getDefault(); |
| 271 | + $default = $parameter->isRequired() ? "''" . wfMsg( 'validator-describe-required' ) . "''" : $parameter->getDefault(); |
273 | 272 | if ( is_array( $default ) ) $default = implode( ', ', $default ); |
274 | | - if ( $default === '' ) $default = "''empty''"; |
| 273 | + if ( $default === '' ) $default = "''" . wfMsg( 'validator-describe-empty' ) . "''"; |
275 | 274 | |
276 | 275 | $description = $parameter->getDescription(); |
277 | 276 | if ( $description === false ) $description = '-'; |
Index: trunk/extensions/Validator/Validator.i18n.php |
— | — | @@ -52,6 +52,15 @@ |
53 | 53 | 'validator-describe-par-hooks' => 'The parser hooks for which to display documentation.', |
54 | 54 | 'validator-describe-par-pre' => 'Allows you to get the actual wikitext for the documentation, without it being rendered on the page.', |
55 | 55 | 'validator-describe-listtype' => 'List of $1 items', |
| 56 | + 'validator-describe-empty' => 'empty', |
| 57 | + 'validator-describe-required' => 'required', |
| 58 | + 'validator-describe-parameter' => 'Parameter', |
| 59 | + 'validator-describe-aliases' => 'Aliases', |
| 60 | + 'validator-describe-type' => 'Type', |
| 61 | + 'validator-describe-default' => 'Default', |
| 62 | + 'validator-describe-description' => 'Description', |
| 63 | + 'validator-describe-parameters' => 'Parameters', |
| 64 | + 'validator-describe-syntax' => 'Syntax', |
56 | 65 | |
57 | 66 | // Criteria errors for single values |
58 | 67 | 'validator_error_empty_argument' => 'Parameter $1 can not have an empty value.', |