r60256 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60255‎ | r60256 | r60257 >
Date:09:08, 21 December 2009
Author:siebrand
Status:deferred
Tags:
Comment:
Support plural in 'transliterator-error-prefix'
Modified paths:
  • /trunk/extensions/Transliterator/Transliterator.i18n.php (modified) (history)
  • /trunk/extensions/Transliterator/Transliterator_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Transliterator/Transliterator_body.php
@@ -402,7 +402,6 @@
403403 * $other is an error messsage to display if $answer is blank and an invalid map is specified
404404 */
405405 function render( &$parser, $mapname = '', $word = '', $format = '$1', $answer = '', $other = '' ) {
406 -
407406 if ( trim( $format ) == '' ) { // Handle the case when people use {{#transliterate:<>|<>||<>}}
408407 $format = '$1';
409408 }
@@ -418,7 +417,9 @@
419418 return $other == '' ? str_replace( "$1", "{{#transliterate:$mapname|$word}}", $format ) : $other;
420419
421420 } else if ( strlen( $prefix ) < 3 ) {
422 - return '<span class="transliterator error">'.wfMsg( 'transliterator-error-prefix', 3, 'transliterator-prefix' ).'</span>';
 421+ return '<span class="transliterator error">' .
 422+ wfMsgExt( 'transliterator-error-prefix', 'parsemag', 3, 'transliterator-prefix' ) .
 423+ '</span>';
423424
424425 }
425426
Index: trunk/extensions/Transliterator/Transliterator.i18n.php
@@ -21,9 +21,9 @@
2222 // $1 is the limit on number of rules
2323 'transliterator-error-rulecount' => "More than $1 {{PLURAL:$1|rule|rules}} in [[MediaWiki:$2]]",
2424 // $3 is the limit on the length of the left hand side (e.g. 'alpha => beta' has 5)
25 - 'transliterator-error-rulesize' => "Rule <code>$1</code> has more than $3 {{PLURAL:$3|character|characters}} on the left in [[MediaWiki:$2]]",
26 - // $1 is the minimum transliterator prefix length, $2 is the name of the message containing the prefix
27 - 'transliterator-error-prefix' => "[[MediaWiki:$2]] must be at least $1 characters long."
 25+ 'transliterator-error-rulesize' => "Rule <code>$1</code> has more than $3 {{PLURAL:$3|character|characters}} on the left in [[MediaWiki:$2]]",
 26+ // $1 is the minimum transliterator prefix length, $2 is the name of the message containing the prefix
 27+ 'transliterator-error-prefix' => "[[MediaWiki:$2]] must be at least $1 {{PLURAL:$1|character|characters}} long."
2828 );
2929
3030 /** Message documentation (Message documentation)

Status & tagging log