Index: trunk/phase3/maintenance/language/messageTypes.inc |
— | — | @@ -199,7 +199,6 @@ |
200 | 200 | 'userrights-irreversible-marker', |
201 | 201 | 'tog-nolangconversion', |
202 | 202 | 'tog-noconvertlink', |
203 | | - 'yourvariant', |
204 | 203 | 'variantname-zh-hans', |
205 | 204 | 'variantname-zh-hant', |
206 | 205 | 'variantname-zh-cn', |
Index: trunk/phase3/includes/Preferences.php |
— | — | @@ -276,13 +276,9 @@ |
277 | 277 | if ( !$wgDisableLangConversion ) { |
278 | 278 | $variants = $wgContLang->getVariants(); |
279 | 279 | |
280 | | - $languages = Language::getLanguageNames(); |
281 | 280 | foreach ( $variants as $v ) { |
282 | 281 | $v = str_replace( '_', '-', strtolower( $v ) ); |
283 | | - if ( array_key_exists( $v, $languages ) ) { |
284 | | - // If it doesn't have a name, we'll pretend it doesn't exist |
285 | | - $variantArray[$v] = $languages[$v]; |
286 | | - } |
| 282 | + $variantArray[$v] = $wgContLang->getVariantname( $v, false ); |
287 | 283 | } |
288 | 284 | |
289 | 285 | $options = array(); |
— | — | @@ -297,6 +293,7 @@ |
298 | 294 | 'type' => 'select', |
299 | 295 | 'options' => $options, |
300 | 296 | 'section' => 'personal/i18n', |
| 297 | + 'help-message' => 'prefs-help-variant', |
301 | 298 | ); |
302 | 299 | } |
303 | 300 | } |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1841,7 +1841,8 @@ |
1842 | 1842 | 'prefs-registration-date-time' => '$1', # only translate this message to other languages if you have to change it |
1843 | 1843 | 'yourrealname' => 'Real name:', |
1844 | 1844 | 'yourlanguage' => 'Language:', |
1845 | | -'yourvariant' => 'Variant:', # only translate this message to other languages if you have to change it |
| 1845 | +'yourvariant' => 'Content language variant:', |
| 1846 | +'prefs-help-variant' => 'Your preferred variant or orthography to display the content pages of this wiki in.', |
1846 | 1847 | 'yournick' => 'New signature:', |
1847 | 1848 | 'prefs-help-signature' => 'Comments on talk pages should be signed with "<nowiki>~~~~</nowiki>" which will be converted into your signature and a timestamp.', |
1848 | 1849 | 'badsig' => 'Invalid raw signature. |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -506,10 +506,20 @@ |
507 | 507 | * short names for language variants used for language conversion links. |
508 | 508 | * |
509 | 509 | * @param $code String |
| 510 | + * @param $usemsg Use the "variantname-xyz" message if it exists |
510 | 511 | * @return string |
511 | 512 | */ |
512 | | - function getVariantname( $code ) { |
513 | | - return $this->getMessageFromDB( "variantname-$code" ); |
| 513 | + function getVariantname( $code, $usemsg = true ) { |
| 514 | + $msg = "variantname-$code"; |
| 515 | + $codeArray = list( $rootCode ) = explode( '-', $code ); |
| 516 | + if( $usemsg && wfMessage( $msg )->exists() ) { |
| 517 | + return $this->getMessageFromDB( $msg ); |
| 518 | + } elseif( $name = self::getLanguageName( $code ) ) { |
| 519 | + return $name; # if it's defined as a language name, show that |
| 520 | + } else { |
| 521 | + # otherwise, output the language code |
| 522 | + return $code; |
| 523 | + } |
514 | 524 | } |
515 | 525 | |
516 | 526 | /** |
— | — | @@ -2504,7 +2514,7 @@ |
2505 | 2515 | /** |
2506 | 2516 | * Normally we output all numbers in plain en_US style, that is |
2507 | 2517 | * 293,291.235 for twohundredninetythreethousand-twohundredninetyone |
2508 | | - * point twohundredthirtyfive. However this is not sutable for all |
| 2518 | + * point twohundredthirtyfive. However this is not suitable for all |
2509 | 2519 | * languages, some such as Pakaran want ੨੯੩,੨੯੫.੨੩੫ and others such as |
2510 | 2520 | * Icelandic just want to use commas instead of dots, and dots instead |
2511 | 2521 | * of commas like "293.291,235". |