Index: trunk/extensions/Polyglot/Polyglot.php |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | * and to lookups for loclaized pages. |
37 | 37 | * Set this to a small set of languages that are likely to be used on your site to |
38 | 38 | * improve performance. Leave NULL to allow all languages known to MediaWiki via |
39 | | -* $wgLanguageNames. |
| 39 | +* languages/Names.php. |
40 | 40 | * If the LanguageSelector extension is installed, $wgLanguageSelectorLanguages is used |
41 | 41 | * as a fallback. |
42 | 42 | */ |
— | — | @@ -77,7 +77,7 @@ |
78 | 78 | } |
79 | 79 | |
80 | 80 | if ( $wgPolyglotLanguages === null ) { |
81 | | - $wgPolyglotLanguages = array_keys( $GLOBALS['wgLanguageNames'] ); |
| 81 | + $wgPolyglotLanguages = array_keys( Language::getLanguageNames() ); |
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
Index: trunk/extensions/LanguageSelector/LanguageSelector.php |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | |
46 | 46 | /** |
47 | 47 | * Languages to offer in the language selector. Per default, this includes all languages MediaWiki knows |
48 | | -* about by virtue of $wgLanguageNames. A shorter list may be more usable, though. |
| 48 | +* about by virtue of languages/Names.php. A shorter list may be more usable, though. |
49 | 49 | */ |
50 | 50 | $wgLanguageSelectorLanguages = null; |
51 | 51 | |
Index: trunk/extensions/SiteMatrix/SiteMatrixApi.php |
— | — | @@ -16,9 +16,9 @@ |
17 | 17 | } |
18 | 18 | |
19 | 19 | public function execute() { |
20 | | - global $wgLanguageNames; |
21 | 20 | $result = $this->getResult(); |
22 | 21 | $matrix = new SiteMatrix(); |
| 22 | + $langNames = Language::getLanguageNames(); |
23 | 23 | |
24 | 24 | $matrix_out = array( |
25 | 25 | 'count' => $matrix->getCount(), |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | $langhost = str_replace( '_', '-', $lang ); |
37 | 37 | $language = array( |
38 | 38 | 'code' => $langhost, |
39 | | - 'name' => $wgLanguageNames[$lang], |
| 39 | + 'name' => $langNames[$lang], |
40 | 40 | 'site' => array(), |
41 | 41 | ); |
42 | 42 | if( isset( $localLanguageNames[$lang] ) ) { |
Index: trunk/extensions/SiteMatrix/SiteMatrix_body.php |
— | — | @@ -282,7 +282,8 @@ |
283 | 283 | } |
284 | 284 | |
285 | 285 | function execute( $par ) { |
286 | | - global $wgOut, $wgRequest, $wgLanguageNames; |
| 286 | + global $wgOut, $wgRequest; |
| 287 | + $langNames = Language::getLanguageNames(); |
287 | 288 | |
288 | 289 | $this->setHeaders(); |
289 | 290 | $this->outputHeader(); |
— | — | @@ -307,7 +308,7 @@ |
308 | 309 | $langhost = str_replace( '_', '-', $lang ); |
309 | 310 | $attribs = array( |
310 | 311 | 'code' => $langhost, |
311 | | - 'name' => $wgLanguageNames[$lang], |
| 312 | + 'name' => $langNames[$lang], |
312 | 313 | ); |
313 | 314 | if( isset( $localLanguageNames[$lang] ) ) { |
314 | 315 | $attribs['localname'] = $localLanguageNames[$lang]; |
— | — | @@ -360,7 +361,7 @@ |
361 | 362 | $attribs['title'] = $localLanguageNames[$lang]; |
362 | 363 | } |
363 | 364 | |
364 | | - $langDisplay = $wgLanguageNames[$lang]; |
| 365 | + $langDisplay = $langNames[$lang]; |
365 | 366 | if ( strlen( $localLanguageNames[$lang] ) && $langDisplay != $localLanguageNames[$lang] ) { |
366 | 367 | $langDisplay .= ' (' . $localLanguageNames[$lang] . ')'; |
367 | 368 | } |
— | — | @@ -426,4 +427,4 @@ |
427 | 428 | $wgOut->addHTML( $s ); |
428 | 429 | $wgOut->addWikiMsg( 'sitematrix-total', $matrix->getCount() ); |
429 | 430 | } |
430 | | -} |
\ No newline at end of file |
| 431 | +} |
Index: trunk/extensions/OtherSites/OtherSites.php |
— | — | @@ -50,6 +50,7 @@ |
51 | 51 | require_once('languages/Names.php'); |
52 | 52 | |
53 | 53 | foreach ( array_keys( $wgOtherSites ) as $key ) { |
| 54 | + /* FIXME: VERY VERY BROKEN */ |
54 | 55 | $wgLanguageNames[$key] = $wgOtherSites[$key]; |
55 | 56 | } |
56 | 57 | } |
Index: trunk/extensions/CentralAuth/CentralAuthUser.php |
— | — | @@ -1092,7 +1092,7 @@ |
1093 | 1093 | * Suppresses a local account of a user. |
1094 | 1094 | */ |
1095 | 1095 | public function doLocalSuppression( $suppress, $wiki, $by, $reason ) { |
1096 | | - global $wgConf, $wgLanguageNames; |
| 1096 | + global $wgConf; |
1097 | 1097 | |
1098 | 1098 | $lb = wfGetLB( $wiki ); |
1099 | 1099 | $dbw = $lb->getConnection( DB_MASTER, array(), $wiki ); |
— | — | @@ -1100,7 +1100,8 @@ |
1101 | 1101 | |
1102 | 1102 | if ( $suppress ) { |
1103 | 1103 | list( $site, $lang ) = $wgConf->siteFromDB( $wiki ); |
1104 | | - $lang = isset( $wgLanguageNames[$lang] ) ? $lang : 'en'; |
| 1104 | + $langNames = Language::getLanguageNames(); |
| 1105 | + $lang = isset( $langNames[$lang] ) ? $lang : 'en'; |
1105 | 1106 | $blockReason = wfMsgReal( 'centralauth-admin-suppressreason', |
1106 | 1107 | array( $by, $reason ), true, $lang ); |
1107 | 1108 | |
Index: trunk/extensions/WikimediaIncubator/SpecialViewUserLang.php |
— | — | @@ -81,8 +81,9 @@ |
82 | 82 | * @param $target Mixed: user whose language and test wiki we're looking up |
83 | 83 | */ |
84 | 84 | function showInfo( $target ) { |
85 | | - global $wgOut, $wgLang, $wgLanguageNames, $wmincPref; |
| 85 | + global $wgOut, $wgLang, $wmincPref; |
86 | 86 | $user = User::newFromName( $target ); |
| 87 | + $langNames = Language::getLanguageNames(); |
87 | 88 | if ( $user == null || $user->getId() == 0 ) { |
88 | 89 | $wgOut->addWikiText( '<span class="error">' . wfMsgNoTrans( 'wminc-viewuserlang-unexisting', $target ) . '</span>' ); |
89 | 90 | } else { |
— | — | @@ -94,7 +95,7 @@ |
95 | 96 | ) ) ); |
96 | 97 | $wgOut->addWikiText( |
97 | 98 | '*' . wfMsg( 'loginlanguagelabel', |
98 | | - $wgLanguageNames[$user->mOptions['language']] . ' (' . $user->mOptions['language'] . ')' |
| 99 | + $langNames[$user->mOptions['language']] . ' (' . $user->mOptions['language'] . ')' |
99 | 100 | ) |
100 | 101 | ); |
101 | 102 | if ( IncubatorTest::isNormalPrefix() == true ) { |
Index: trunk/extensions/GetFamily/GetFamily.php |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | } |
46 | 46 | |
47 | 47 | function execute() { |
48 | | - global $wgRequest, $wgLanguageNames, $wgUser, $wgOut; |
| 48 | + global $wgRequest, $wgUser, $wgOut; |
49 | 49 | global $wgScript, $wgDBname, $wgLanguageCode, $wgSitename, $wgServer, $wgArticlePath, $wgVersion; |
50 | 50 | |
51 | 51 | if( !$wgUser->isAllowed( 'getfamily' ) ){ |
— | — | @@ -87,7 +87,8 @@ |
88 | 88 | } else { |
89 | 89 | header( 'Content-Type: text/plain' ); |
90 | 90 | |
91 | | - $langcodes = array_keys( $wgLanguageNames ); |
| 91 | + $langNames = Language::getLanguageNames(); |
| 92 | + $langcodes = array_keys( $langNames ); |
92 | 93 | |
93 | 94 | $dbr = wfGetDB( DB_SLAVE ); |
94 | 95 | foreach ( $langcodes as $lang_code ) { |