Index: trunk/phase3/CREDITS |
— | — | @@ -69,6 +69,7 @@ |
70 | 70 | * Michael De La Rue |
71 | 71 | * Mike Horvath |
72 | 72 | * Mormegil |
| 73 | +* Nakon |
73 | 74 | * Nathan Larson |
74 | 75 | * Nikolaos S. Karastathis |
75 | 76 | * Olaf Lenz |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -629,7 +629,7 @@ |
630 | 630 | 'mytalk' => 'My talk', |
631 | 631 | 'anontalk' => 'Talk for this IP', |
632 | 632 | 'navigation' => 'Navigation', |
633 | | -'and' => ', and', |
| 633 | +'and' => ' and', |
634 | 634 | |
635 | 635 | # Metadata in edit box |
636 | 636 | 'metadata_help' => 'Metadata:', |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -1938,26 +1938,33 @@ |
1939 | 1939 | |
1940 | 1940 | |
1941 | 1941 | /** |
1942 | | - * For the credit list in includes/Credits.php (action=credits) |
| 1942 | + * Take a list of strings and build a locale-friendly comma-separated |
| 1943 | + * list, using the local comma-separator message. |
| 1944 | + * The last two strings are chained with an "and". |
1943 | 1945 | * |
1944 | 1946 | * @param $l Array |
1945 | 1947 | * @return string |
1946 | 1948 | */ |
1947 | 1949 | function listToText( $l ) { |
1948 | 1950 | $s = ''; |
1949 | | - $m = count($l) - 1; |
1950 | | - for ($i = $m; $i >= 0; $i--) { |
1951 | | - if ($i == $m) { |
1952 | | - $s = $l[$i]; |
1953 | | - } else if ($i == $m - 1) { |
1954 | | - $s = $l[$i] . $this->getMessageFromDB( 'and' ) . $this->getMessageFromDB( 'word-separator' ) . $s; |
1955 | | - } else { |
1956 | | - $s = $l[$i] . $this->getMessageFromDB( 'comma-separator' ) . $s; |
| 1951 | + $m = count( $l ) - 1; |
| 1952 | + if( $m == 1 ) { |
| 1953 | + return $l[0] . $this->getMessageFromDB( 'and' ) . $this->getMessageFromDB( 'word-separator' ) . $l[1]; |
| 1954 | + } |
| 1955 | + else { |
| 1956 | + for ( $i = $m; $i >= 0; $i-- ) { |
| 1957 | + if ( $i == $m ) { |
| 1958 | + $s = $l[$i]; |
| 1959 | + } else if( $i == $m - 1 ) { |
| 1960 | + $s = $l[$i] . $this->getMessageFromDB( 'and' ) . $this->getMessageFromDB( 'word-separator' ) . $s; |
| 1961 | + } else { |
| 1962 | + $s = $l[$i] . $this->getMessageFromDB( 'comma-separator' ) . $s; |
| 1963 | + } |
1957 | 1964 | } |
| 1965 | + return $s; |
1958 | 1966 | } |
1959 | | - return $s; |
1960 | 1967 | } |
1961 | | - |
| 1968 | + |
1962 | 1969 | /** |
1963 | 1970 | * Take a list of strings and build a locale-friendly comma-separated |
1964 | 1971 | * list, using the local comma-separator message. |