* Bug 16484 Remove an unneeded extra comma in user rights log (and other lists)

** Removed the comma from MediaWiki:and (@Translatewiki staff: no fuzzying needed)
** Special case for two messages in log
** Function description updated
Based on a patch by Nakon
This commit is contained in:
Raimond Spekking 2008-12-27 19:58:11 +00:00
parent d7f7a5052f
commit 364f6133db
3 changed files with 21 additions and 13 deletions

View file

@ -69,6 +69,7 @@ following names for their contribution to the product.
* Michael De La Rue
* Mike Horvath
* Mormegil
* Nakon
* Nathan Larson
* Nikolaos S. Karastathis
* Olaf Lenz

View file

@ -1938,26 +1938,33 @@ class Language {
/**
* For the credit list in includes/Credits.php (action=credits)
* Take a list of strings and build a locale-friendly comma-separated
* list, using the local comma-separator message.
* The last two strings are chained with an "and".
*
* @param $l Array
* @return string
*/
function listToText( $l ) {
$s = '';
$m = count($l) - 1;
for ($i = $m; $i >= 0; $i--) {
if ($i == $m) {
$s = $l[$i];
} else if ($i == $m - 1) {
$s = $l[$i] . $this->getMessageFromDB( 'and' ) . $this->getMessageFromDB( 'word-separator' ) . $s;
} else {
$s = $l[$i] . $this->getMessageFromDB( 'comma-separator' ) . $s;
}
$m = count( $l ) - 1;
if( $m == 1 ) {
return $l[0] . $this->getMessageFromDB( 'and' ) . $this->getMessageFromDB( 'word-separator' ) . $l[1];
}
else {
for ( $i = $m; $i >= 0; $i-- ) {
if ( $i == $m ) {
$s = $l[$i];
} else if( $i == $m - 1 ) {
$s = $l[$i] . $this->getMessageFromDB( 'and' ) . $this->getMessageFromDB( 'word-separator' ) . $s;
} else {
$s = $l[$i] . $this->getMessageFromDB( 'comma-separator' ) . $s;
}
}
return $s;
}
return $s;
}
/**
* Take a list of strings and build a locale-friendly comma-separated
* list, using the local comma-separator message.

View file

@ -629,7 +629,7 @@ XHTML id names.
'mytalk' => 'My talk',
'anontalk' => 'Talk for this IP',
'navigation' => 'Navigation',
'and' => ', and',
'and' => ' and',
# Metadata in edit box
'metadata_help' => 'Metadata:',