Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -861,6 +861,13 @@ |
862 | 862 | /** List of language names or overrides for default names in Names.php */ |
863 | 863 | $wgExtraLanguageNames = array(); |
864 | 864 | |
| 865 | +/** |
| 866 | + * List of language codes that don't correspond to an actual language. |
| 867 | + * These codes are leftoffs from renames, or other legacy things. |
| 868 | + * Also, qqq is a dummy "language" for documenting messages. |
| 869 | + */ |
| 870 | +$wgDummyLanguageCodes = array( 'qqq', 'als', 'be-x-old', 'dk', 'fiu-vro', 'iu', 'nb', 'simple', 'tp' ); |
| 871 | + |
865 | 872 | /** We speak UTF-8 all the time now, unless some oddities happen */ |
866 | 873 | $wgInputEncoding = 'UTF-8'; |
867 | 874 | $wgOutputEncoding = 'UTF-8'; |
Index: trunk/phase3/config/Installer.php |
— | — | @@ -2118,34 +2118,13 @@ |
2119 | 2119 | } |
2120 | 2120 | |
2121 | 2121 | function getLanguageList() { |
2122 | | - global $wgLanguageNames, $IP; |
2123 | | - if( !isset( $wgLanguageNames ) ) { |
2124 | | - require_once( "$IP/languages/Names.php" ); |
2125 | | - } |
| 2122 | + global $wgDummyLanguageCodes; |
2126 | 2123 | |
2127 | 2124 | $codes = array(); |
2128 | | - |
2129 | | - // qqq is a dummy "language" for documenting messages, other language codes are legacy/fallback. |
2130 | | - $blacklist = array( 'qqq', 'als', 'be-x-old', 'dk', 'fiu-vro', 'iu', 'nb', 'simple', 'tp' ); |
2131 | | - |
2132 | | - $d = opendir( "../languages/messages" ); |
2133 | | - /* In case we are called from the root directory */ |
2134 | | - if (!$d) |
2135 | | - $d = opendir( "languages/messages"); |
2136 | | - while( false !== ($f = readdir( $d ) ) ) { |
2137 | | - $m = array(); |
2138 | | - if( preg_match( '/Messages([A-Z][a-z_]+)\.php$/', $f, $m ) ) { |
2139 | | - $code = str_replace( '_', '-', strtolower( $m[1] ) ); |
2140 | | - if( in_array( $code, $blacklist ) ) continue; |
2141 | | - if( isset( $wgLanguageNames[$code] ) ) { |
2142 | | - $name = wfBCP47( $code ) . ' - ' . $wgLanguageNames[$code]; |
2143 | | - } else { |
2144 | | - $name = $code; |
2145 | | - } |
2146 | | - $codes[$code] = $name; |
2147 | | - } |
| 2125 | + foreach ( Language::getLanguageNames() as $code => $name ) { |
| 2126 | + if( in_array( $code, $wgDummyLanguageCodes ) ) continue; |
| 2127 | + $codes[$code] = $code . ' - ' . $name; |
2148 | 2128 | } |
2149 | | - closedir( $d ); |
2150 | 2129 | ksort( $codes ); |
2151 | 2130 | return $codes; |
2152 | 2131 | } |