Index: trunk/extensions/cldr/CurrencyNames.body.php |
— | — | @@ -9,18 +9,4 @@ |
10 | 10 | */ |
11 | 11 | class CurrencyNames { |
12 | 12 | // TODO: build this class |
13 | | - |
14 | | - private static $cache = array(); |
15 | | - |
16 | | - public static function getNames( $code ) { |
17 | | - return false; |
18 | | - } |
19 | | - |
20 | | - public static function getFileName( $code ) { |
21 | | - return Language::getFileName( "CldrNames", $code, '.php' ); |
22 | | - } |
23 | | - |
24 | | - public static function getOverrideFileName( $code ) { |
25 | | - return Language::getFileName( "LocalNames", $code, '.php' ); |
26 | | - } |
27 | 13 | } |
Index: trunk/extensions/cldr/rebuild.php |
— | — | @@ -223,7 +223,7 @@ |
224 | 224 | if ( !isset( $attrs["DRAFT"] ) ) { // Exclude names that are draft |
225 | 225 | if ( !isset( $attrs["ALT"] ) || ( isset( $attrs["ALT"] ) && $attrs["ALT"] == 'short' ) ) { |
226 | 226 | preg_match( '/[A-Z][A-Z]/', $attrs['TYPE'], $matches ); |
227 | | - if ( $matches ) { |
| 227 | + if ( $matches && $matches[0] !== 'ZZ' ) { // Exclude ZZ => Unknown Region |
228 | 228 | $this->parseContents = true; |
229 | 229 | $type = $matches[0]; |
230 | 230 | $this->output .= "'$type' => '"; |
Index: trunk/extensions/cldr/CountryNames.body.php |
— | — | @@ -9,18 +9,4 @@ |
10 | 10 | */ |
11 | 11 | class CountryNames { |
12 | 12 | // TODO: build this class |
13 | | - |
14 | | - private static $cache = array(); |
15 | | - |
16 | | - public static function getNames( $code ) { |
17 | | - return false; |
18 | | - } |
19 | | - |
20 | | - public static function getFileName( $code ) { |
21 | | - return Language::getFileName( "CldrNames", $code, '.php' ); |
22 | | - } |
23 | | - |
24 | | - public static function getOverrideFileName( $code ) { |
25 | | - return Language::getFileName( "LocalNames", $code, '.php' ); |
26 | | - } |
27 | 13 | } |
Index: trunk/extensions/cldr/LanguageNames.body.php |
— | — | @@ -17,7 +17,12 @@ |
18 | 18 | const LIST_MW = 1; // All names that are in Names.php |
19 | 19 | const LIST_MW_AND_CLDR = 2; // Combination of Names.php and what is in cldr |
20 | 20 | |
21 | | - |
| 21 | + /** |
| 22 | + * Get localized language names for a particular language, using fallback languages for missing |
| 23 | + * items. |
| 24 | + * |
| 25 | + * @return an associative array of language codes and localized language names |
| 26 | + */ |
22 | 27 | public static function getNames( $code, $fbMethod = self::FALLBACK_NATIVE, $list = self::LIST_MW ) { |
23 | 28 | $xx = self::loadLanguage( $code ); |
24 | 29 | $native = Language::getLanguageNames( $list === self::LIST_MW_SUPPORTED ); |
— | — | @@ -57,8 +62,13 @@ |
58 | 63 | |
59 | 64 | } |
60 | 65 | |
| 66 | + /** |
| 67 | + * Load language names localized for a particular language. |
| 68 | + * |
| 69 | + * @return an associative array of language codes and localized language names |
| 70 | + */ |
61 | 71 | private static function loadLanguage( $code ) { |
62 | | - if ( !isset(self::$cache[$code]) ) { |
| 72 | + if ( !isset( self::$cache[$code] ) ) { |
63 | 73 | wfProfileIn( __METHOD__.'-recache' ); |
64 | 74 | |
65 | 75 | /* Load override for wrong or missing entries in cldr */ |