r79251 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79250‎ | r79251 | r79252 >
Date:13:18, 30 December 2010
Author:jeroendedauw
Status:deferred (Comments)
Tags:
Comment:
Fixed hardoced messages, follow up to r79201
Modified paths:
  • /trunk/extensions/Validator/Validator.i18n.php (modified) (history)
  • /trunk/extensions/Validator/includes/parserHooks/Validator_Describe.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/includes/parserHooks/Validator_Describe.php
@@ -193,7 +193,7 @@
194194 * @return string
195195 */
196196 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";
198198
199199 $params = array();
200200
@@ -233,22 +233,21 @@
234234 }
235235
236236 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 );
243245
244246 $table = implode( "\n|-\n", $tableRows );
245247
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|}";
253252 }
254253
255254 return $table;
@@ -268,9 +267,9 @@
269268 $aliases = $parameter->getAliases();
270269 $aliases = count( $aliases ) > 0 ? implode( ', ', $aliases ) : '-';
271270
272 - $default = $parameter->isRequired() ? "''required''" : $parameter->getDefault();
 271+ $default = $parameter->isRequired() ? "''" . wfMsg( 'validator-describe-required' ) . "''" : $parameter->getDefault();
273272 if ( is_array( $default ) ) $default = implode( ', ', $default );
274 - if ( $default === '' ) $default = "''empty''";
 273+ if ( $default === '' ) $default = "''" . wfMsg( 'validator-describe-empty' ) . "''";
275274
276275 $description = $parameter->getDescription();
277276 if ( $description === false ) $description = '-';
Index: trunk/extensions/Validator/Validator.i18n.php
@@ -52,6 +52,15 @@
5353 'validator-describe-par-hooks' => 'The parser hooks for which to display documentation.',
5454 'validator-describe-par-pre' => 'Allows you to get the actual wikitext for the documentation, without it being rendered on the page.',
5555 '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',
5665
5766 // Criteria errors for single values
5867 'validator_error_empty_argument' => 'Parameter $1 can not have an empty value.',

Follow-up revisions

RevisionCommit summaryAuthorDate
r79252Follow-up r79251: Rename messages because 2 of them ('Validator-describe-desc...raymond14:00, 30 December 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r79201Added parameter type and description stuff to the describe parser hookjeroendedauw21:00, 29 December 2010

Comments

#Comment by Raymond (talk | contribs)   13:47, 30 December 2010

You are using message key 'validator-describe-aliases' twice now:

1. in above revsion

2. in $description .= wfMsgExt( 'validator-describe-aliases', 'parsemag', $wgLang->listToText( $aliases ), count( $aliases ) );

#Comment by Raymond (talk | contribs)   13:47, 30 December 2010

And 'Validator-describe-description' too.

#Comment by Jeroen De Dauw (talk | contribs)   13:53, 30 December 2010

I'm not directly seeing the issue - can you just go ahead and fix it?

#Comment by Raymond (talk | contribs)   14:03, 30 December 2010

Done with r79252.

Status & tagging log