Index: trunk/phase3/maintenance/parserTests.inc |
— | — | @@ -550,7 +550,6 @@ |
551 | 551 | 'wgSitename' => 'MediaWiki', |
552 | 552 | 'wgServerName' => 'Britney-Spears', |
553 | 553 | 'wgLanguageCode' => $lang, |
554 | | - 'wgContLanguageCode' => $lang, |
555 | 554 | 'wgDBprefix' => $wgDBtype != 'oracle' ? 'parsertest_' : 'pt_', |
556 | 555 | 'wgRawHtml' => isset( $opts['rawhtml'] ), |
557 | 556 | 'wgLang' => null, |
Index: trunk/phase3/maintenance/tests/MessageTest.php |
— | — | @@ -3,9 +3,9 @@ |
4 | 4 | class MessageTest extends PHPUnit_Framework_TestCase { |
5 | 5 | |
6 | 6 | function setUp() { |
7 | | - global $wgContLanguageCode; |
| 7 | + global $wgLanguageCode; |
8 | 8 | |
9 | | - $wgContLanguageCode = 'en'; # For mainpage to be 'Main Page' |
| 9 | + $wgLanguageCode = 'en'; # For mainpage to be 'Main Page' |
10 | 10 | } |
11 | 11 | |
12 | 12 | function testExists() { |
Index: trunk/phase3/includes/Xml.php |
— | — | @@ -214,14 +214,14 @@ |
215 | 215 | * @return array of label and select |
216 | 216 | */ |
217 | 217 | public static function languageSelector( $selected, $customisedOnly = true ) { |
218 | | - global $wgContLanguageCode; |
| 218 | + global $wgLanguageCode; |
219 | 219 | /** |
220 | 220 | * Make sure the site language is in the list; a custom language code |
221 | 221 | * might not have a defined name... |
222 | 222 | */ |
223 | 223 | $languages = Language::getLanguageNames( $customisedOnly ); |
224 | | - if( !array_key_exists( $wgContLanguageCode, $languages ) ) { |
225 | | - $languages[$wgContLanguageCode] = $wgContLanguageCode; |
| 224 | + if( !array_key_exists( $wgLanguageCode, $languages ) ) { |
| 225 | + $languages[$wgLanguageCode] = $wgLanguageCode; |
226 | 226 | } |
227 | 227 | ksort( $languages ); |
228 | 228 | |
— | — | @@ -230,7 +230,7 @@ |
231 | 231 | * Otherwise, no default is selected and the user ends up |
232 | 232 | * with an Afrikaans interface since it's first in the list. |
233 | 233 | */ |
234 | | - $selected = isset( $languages[$selected] ) ? $selected : $wgContLanguageCode; |
| 234 | + $selected = isset( $languages[$selected] ) ? $selected : $wgLanguageCode; |
235 | 235 | $options = "\n"; |
236 | 236 | foreach( $languages as $code => $name ) { |
237 | 237 | $options .= Xml::option( "$code - $name", $code, ($code == $selected) ) . "\n"; |
Index: trunk/phase3/includes/StubObject.php |
— | — | @@ -122,8 +122,8 @@ |
123 | 123 | } |
124 | 124 | |
125 | 125 | function _newObject() { |
126 | | - global $wgContLanguageCode; |
127 | | - $obj = Language::factory( $wgContLanguageCode ); |
| 126 | + global $wgLanguageCode; |
| 127 | + $obj = Language::factory( $wgLanguageCode ); |
128 | 128 | $obj->initEncoding(); |
129 | 129 | $obj->initContLang(); |
130 | 130 | return $obj; |
— | — | @@ -146,7 +146,7 @@ |
147 | 147 | } |
148 | 148 | |
149 | 149 | function _newObject() { |
150 | | - global $wgContLanguageCode, $wgRequest, $wgUser, $wgContLang; |
| 150 | + global $wgLanguageCode, $wgRequest, $wgUser, $wgContLang; |
151 | 151 | $code = $wgRequest->getVal( 'uselang', $wgUser->getOption( 'language' ) ); |
152 | 152 | // BCP 47 - letter case MUST NOT carry meaning |
153 | 153 | $code = strtolower( $code ); |
— | — | @@ -154,10 +154,10 @@ |
155 | 155 | # Validate $code |
156 | 156 | if( empty( $code ) || !preg_match( '/^[a-z-]+$/', $code ) || ( $code === 'qqq' ) ) { |
157 | 157 | wfDebug( "Invalid user language code\n" ); |
158 | | - $code = $wgContLanguageCode; |
| 158 | + $code = $wgLanguageCode; |
159 | 159 | } |
160 | 160 | |
161 | | - if( $code === $wgContLanguageCode ) { |
| 161 | + if( $code === $wgLanguageCode ) { |
162 | 162 | return $wgContLang; |
163 | 163 | } else { |
164 | 164 | $obj = Language::factory( $code ); |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -2785,8 +2785,8 @@ |
2786 | 2786 | case 'directionmark': |
2787 | 2787 | return $wgContLang->getDirMark(); |
2788 | 2788 | case 'contentlanguage': |
2789 | | - global $wgContLanguageCode; |
2790 | | - return $wgContLanguageCode; |
| 2789 | + global $wgLanguageCode; |
| 2790 | + return $wgLanguageCode; |
2791 | 2791 | default: |
2792 | 2792 | $ret = null; |
2793 | 2793 | if ( wfRunHooks( 'ParserGetVariableValueSwitch', array( &$this, &$this->mVarCache, &$index, &$ret, &$frame ) ) ) { |
Index: trunk/phase3/includes/MessageCache.php |
— | — | @@ -334,7 +334,7 @@ |
335 | 335 | */ |
336 | 336 | function loadFromDB( $code ) { |
337 | 337 | wfProfileIn( __METHOD__ ); |
338 | | - global $wgMaxMsgCacheEntrySize, $wgContLanguageCode, $wgAdaptiveMessageCache; |
| 338 | + global $wgMaxMsgCacheEntrySize, $wgLanguageCode, $wgAdaptiveMessageCache; |
339 | 339 | $dbr = wfGetDB( DB_SLAVE ); |
340 | 340 | $cache = array(); |
341 | 341 | |
— | — | @@ -347,14 +347,14 @@ |
348 | 348 | $mostused = array(); |
349 | 349 | if ( $wgAdaptiveMessageCache ) { |
350 | 350 | $mostused = $this->getMostUsedMessages(); |
351 | | - if ( $code !== $wgContLanguageCode ) { |
| 351 | + if ( $code !== $wgLanguageCode ) { |
352 | 352 | foreach ( $mostused as $key => $value ) $mostused[$key] = "$value/$code"; |
353 | 353 | } |
354 | 354 | } |
355 | 355 | |
356 | 356 | if ( count( $mostused ) ) { |
357 | 357 | $conds['page_title'] = $mostused; |
358 | | - } elseif ( $code !== $wgContLanguageCode ) { |
| 358 | + } elseif ( $code !== $wgLanguageCode ) { |
359 | 359 | $conds[] = 'page_title' . $dbr->buildLike( $dbr->anyString(), "/$code" ); |
360 | 360 | } else { |
361 | 361 | # Effectively disallows use of '/' character in NS_MEDIAWIKI for uses |
— | — | @@ -534,7 +534,7 @@ |
535 | 535 | * "msg/lang". |
536 | 536 | */ |
537 | 537 | function get( $key, $useDB = true, $langcode = true, $isFullKey = false ) { |
538 | | - global $wgContLanguageCode, $wgContLang; |
| 538 | + global $wgLanguageCode, $wgContLang; |
539 | 539 | |
540 | 540 | if ( !is_string( $key ) ) { |
541 | 541 | throw new MWException( "Non-string key given" ); |
— | — | @@ -568,7 +568,7 @@ |
569 | 569 | # Try the MediaWiki namespace |
570 | 570 | if( !$this->mDisable && $useDB ) { |
571 | 571 | $title = $uckey; |
572 | | - if(!$isFullKey && ( $langcode != $wgContLanguageCode ) ) { |
| 572 | + if(!$isFullKey && ( $langcode != $wgLanguageCode ) ) { |
573 | 573 | $title .= '/' . $langcode; |
574 | 574 | } |
575 | 575 | $message = $this->getMsgFromNamespace( $title, $langcode ); |
— | — | @@ -599,8 +599,8 @@ |
600 | 600 | # Is this a custom message? Try the default language in the db... |
601 | 601 | if( ($message === false || $message === '-' ) && |
602 | 602 | !$this->mDisable && $useDB && |
603 | | - !$isFullKey && ($langcode != $wgContLanguageCode) ) { |
604 | | - $message = $this->getMsgFromNamespace( $uckey, $wgContLanguageCode ); |
| 603 | + !$isFullKey && ($langcode != $wgLanguageCode) ) { |
| 604 | + $message = $this->getMsgFromNamespace( $uckey, $wgLanguageCode ); |
605 | 605 | } |
606 | 606 | |
607 | 607 | # Final fallback |
— | — | @@ -813,15 +813,15 @@ |
814 | 814 | } |
815 | 815 | |
816 | 816 | public function figureMessage( $key ) { |
817 | | - global $wgContLanguageCode; |
| 817 | + global $wgLanguageCode; |
818 | 818 | $pieces = explode( '/', $key ); |
819 | 819 | if( count( $pieces ) < 2 ) |
820 | | - return array( $key, $wgContLanguageCode ); |
| 820 | + return array( $key, $wgLanguageCode ); |
821 | 821 | |
822 | 822 | $lang = array_pop( $pieces ); |
823 | 823 | $validCodes = Language::getLanguageNames(); |
824 | 824 | if( !array_key_exists( $lang, $validCodes ) ) |
825 | | - return array( $key, $wgContLanguageCode ); |
| 825 | + return array( $key, $wgLanguageCode ); |
826 | 826 | |
827 | 827 | $message = implode( '/', $pieces ); |
828 | 828 | return array( $message, $lang ); |
Index: trunk/phase3/includes/Feed.php |
— | — | @@ -137,8 +137,8 @@ |
138 | 138 | * @return String |
139 | 139 | */ |
140 | 140 | public function getLanguage() { |
141 | | - global $wgContLanguageCode; |
142 | | - return $wgContLanguageCode; |
| 141 | + global $wgLanguageCode; |
| 142 | + return $wgLanguageCode; |
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
Index: trunk/phase3/includes/Export.php |
— | — | @@ -362,7 +362,7 @@ |
363 | 363 | * @return string |
364 | 364 | */ |
365 | 365 | function openStream() { |
366 | | - global $wgContLanguageCode; |
| 366 | + global $wgLanguageCode; |
367 | 367 | $ver = $this->schemaVersion(); |
368 | 368 | return Xml::element( 'mediawiki', array( |
369 | 369 | 'xmlns' => "http://www.mediawiki.org/xml/export-$ver/", |
— | — | @@ -370,7 +370,7 @@ |
371 | 371 | 'xsi:schemaLocation' => "http://www.mediawiki.org/xml/export-$ver/ " . |
372 | 372 | "http://www.mediawiki.org/xml/export-$ver.xsd", |
373 | 373 | 'version' => $ver, |
374 | | - 'xml:lang' => $wgContLanguageCode ), |
| 374 | + 'xml:lang' => $wgLanguageCode ), |
375 | 375 | null ) . |
376 | 376 | "\n" . |
377 | 377 | $this->siteInfo(); |
Index: trunk/phase3/includes/ChangesFeed.php |
— | — | @@ -27,8 +27,8 @@ |
28 | 28 | * @return ChannelFeed subclass or false on failure |
29 | 29 | */ |
30 | 30 | public function getFeedObject( $title, $description ) { |
31 | | - global $wgSitename, $wgContLanguageCode, $wgFeedClasses, $wgTitle; |
32 | | - $feedTitle = "$wgSitename - {$title} [$wgContLanguageCode]"; |
| 31 | + global $wgSitename, $wgLanguageCode, $wgFeedClasses, $wgTitle; |
| 32 | + $feedTitle = "$wgSitename - {$title} [$wgLanguageCode]"; |
33 | 33 | if( !isset($wgFeedClasses[$this->format] ) ) |
34 | 34 | return false; |
35 | 35 | return new $wgFeedClasses[$this->format]( |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -1569,7 +1569,7 @@ |
1570 | 1570 | */ |
1571 | 1571 | public function output() { |
1572 | 1572 | global $wgUser, $wgOutputEncoding, $wgRequest; |
1573 | | - global $wgContLanguageCode, $wgDebugRedirects, $wgMimeType; |
| 1573 | + global $wgLanguageCode, $wgDebugRedirects, $wgMimeType; |
1574 | 1574 | global $wgUseAjax, $wgAjaxWatch; |
1575 | 1575 | global $wgEnableMWSuggest, $wgUniversalEditButton; |
1576 | 1576 | global $wgArticle; |
— | — | @@ -1657,7 +1657,7 @@ |
1658 | 1658 | ob_start(); |
1659 | 1659 | |
1660 | 1660 | $wgRequest->response()->header( "Content-type: $wgMimeType; charset={$wgOutputEncoding}" ); |
1661 | | - $wgRequest->response()->header( 'Content-language: ' . $wgContLanguageCode ); |
| 1661 | + $wgRequest->response()->header( 'Content-language: ' . $wgLanguageCode ); |
1662 | 1662 | |
1663 | 1663 | if ( $this->mArticleBodyOnly ) { |
1664 | 1664 | $this->out( $this->mBodytext ); |
Index: trunk/phase3/includes/api/ApiFeedWatchlist.php |
— | — | @@ -54,7 +54,7 @@ |
55 | 55 | * Wrap the result as an RSS/Atom feed. |
56 | 56 | */ |
57 | 57 | public function execute() { |
58 | | - global $wgFeedClasses, $wgFeedLimit, $wgSitename, $wgContLanguageCode; |
| 58 | + global $wgFeedClasses, $wgFeedLimit, $wgSitename, $wgLanguageCode; |
59 | 59 | |
60 | 60 | try { |
61 | 61 | $params = $this->extractRequestParams(); |
— | — | @@ -102,7 +102,7 @@ |
103 | 103 | $feedItems[] = $this->createFeedItem( $info ); |
104 | 104 | } |
105 | 105 | |
106 | | - $feedTitle = $wgSitename . ' - ' . wfMsgForContent( 'watchlist' ) . ' [' . $wgContLanguageCode . ']'; |
| 106 | + $feedTitle = $wgSitename . ' - ' . wfMsgForContent( 'watchlist' ) . ' [' . $wgLanguageCode . ']'; |
107 | 107 | $feedUrl = SpecialPage::getTitleFor( 'Watchlist' )->getFullURL(); |
108 | 108 | |
109 | 109 | $feed = new $wgFeedClasses[$params['feedformat']] ( $feedTitle, htmlspecialchars( wfMsgForContent( 'watchlist' ) ), $feedUrl ); |
— | — | @@ -114,7 +114,7 @@ |
115 | 115 | // Error results should not be cached |
116 | 116 | $this->getMain()->setCacheMaxAge( 0 ); |
117 | 117 | |
118 | | - $feedTitle = $wgSitename . ' - Error - ' . wfMsgForContent( 'watchlist' ) . ' [' . $wgContLanguageCode . ']'; |
| 118 | + $feedTitle = $wgSitename . ' - Error - ' . wfMsgForContent( 'watchlist' ) . ' [' . $wgLanguageCode . ']'; |
119 | 119 | $feedUrl = SpecialPage::getTitleFor( 'Watchlist' )->getFullURL(); |
120 | 120 | |
121 | 121 | $feedFormat = isset( $params['feedformat'] ) ? $params['feedformat'] : 'rss'; |
Index: trunk/phase3/includes/HTMLFileCache.php |
— | — | @@ -134,7 +134,7 @@ |
135 | 135 | |
136 | 136 | /* Working directory to/from output */ |
137 | 137 | public function loadFromFileCache() { |
138 | | - global $wgOut, $wgMimeType, $wgOutputEncoding, $wgContLanguageCode; |
| 138 | + global $wgOut, $wgMimeType, $wgOutputEncoding, $wgLanguageCode; |
139 | 139 | wfDebug( __METHOD__ . "()\n"); |
140 | 140 | $filename = $this->fileCacheName(); |
141 | 141 | // Raw pages should handle cache control on their own, |
— | — | @@ -142,7 +142,7 @@ |
143 | 143 | if( $this->mType !== 'raw' ) { |
144 | 144 | $wgOut->sendCacheControl(); |
145 | 145 | header( "Content-Type: $wgMimeType; charset={$wgOutputEncoding}" ); |
146 | | - header( "Content-Language: $wgContLanguageCode" ); |
| 146 | + header( "Content-Language: $wgLanguageCode" ); |
147 | 147 | } |
148 | 148 | |
149 | 149 | if( $this->useGzip() ) { |
Index: trunk/phase3/includes/StreamFile.php |
— | — | @@ -41,8 +41,8 @@ |
42 | 42 | return; |
43 | 43 | } |
44 | 44 | |
45 | | - global $wgContLanguageCode; |
46 | | - header( "Content-Disposition: inline;filename*=utf-8'$wgContLanguageCode'" . urlencode( basename( $fname ) ) ); |
| 45 | + global $wgLanguageCode; |
| 46 | + header( "Content-Disposition: inline;filename*=utf-8'$wgLanguageCode'" . urlencode( basename( $fname ) ) ); |
47 | 47 | |
48 | 48 | foreach ( $headers as $header ) { |
49 | 49 | header( $header ); |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -133,7 +133,7 @@ |
134 | 134 | */ |
135 | 135 | function outputPage( OutputPage $out ) { |
136 | 136 | global $wgArticle, $wgUser, $wgLang, $wgContLang; |
137 | | - global $wgScript, $wgStylePath, $wgContLanguageCode; |
| 137 | + global $wgScript, $wgStylePath, $wgLanguageCode; |
138 | 138 | global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgRequest; |
139 | 139 | global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces, $wgHtml5Version; |
140 | 140 | global $wgDisableCounters, $wgLogo, $wgHideInterlanguageLinks; |
— | — | @@ -426,7 +426,7 @@ |
427 | 427 | $printfooter = "<div class=\"printfooter\">\n" . $this->printSource() . "</div>\n"; |
428 | 428 | global $wgBetterDirectionality; |
429 | 429 | if ( $wgBetterDirectionality ) { |
430 | | - $realBodyAttribs = array( 'lang' => $wgContLanguageCode, 'dir' => $wgContLang->getDir() ); |
| 430 | + $realBodyAttribs = array( 'lang' => $wgLanguageCode, 'dir' => $wgContLang->getDir() ); |
431 | 431 | $out->mBodytext = Html::rawElement( 'div', $realBodyAttribs, $out->mBodytext ); |
432 | 432 | } |
433 | 433 | $out->mBodytext .= $printfooter . $this->generateDebugHTML(); |
Index: trunk/phase3/includes/specials/SpecialNewpages.php |
— | — | @@ -374,10 +374,10 @@ |
375 | 375 | } |
376 | 376 | |
377 | 377 | protected function feedTitle() { |
378 | | - global $wgContLanguageCode, $wgSitename; |
| 378 | + global $wgLanguageCode, $wgSitename; |
379 | 379 | $page = SpecialPage::getPage( 'Newpages' ); |
380 | 380 | $desc = $page->getDescription(); |
381 | | - return "$wgSitename - $desc [$wgContLanguageCode]"; |
| 381 | + return "$wgSitename - $desc [$wgLanguageCode]"; |
382 | 382 | } |
383 | 383 | |
384 | 384 | protected function feedItem( $row ) { |
Index: trunk/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -428,10 +428,10 @@ |
429 | 429 | } |
430 | 430 | |
431 | 431 | protected function feedTitle() { |
432 | | - global $wgContLanguageCode, $wgSitename; |
| 432 | + global $wgLanguageCode, $wgSitename; |
433 | 433 | $page = SpecialPage::getPage( 'Contributions' ); |
434 | 434 | $desc = $page->getDescription(); |
435 | | - return "$wgSitename - $desc [$wgContLanguageCode]"; |
| 435 | + return "$wgSitename - $desc [$wgLanguageCode]"; |
436 | 436 | } |
437 | 437 | |
438 | 438 | protected function feedItem( $row ) { |
Index: trunk/phase3/includes/Metadata.php |
— | — | @@ -63,11 +63,11 @@ |
64 | 64 | } |
65 | 65 | |
66 | 66 | protected function basics() { |
67 | | - global $wgContLanguageCode, $wgSitename; |
| 67 | + global $wgLanguageCode, $wgSitename; |
68 | 68 | |
69 | 69 | $this->element( 'title', $this->mArticle->mTitle->getText() ); |
70 | 70 | $this->pageOrString( 'publisher', wfMsg( 'aboutpage' ), $wgSitename ); |
71 | | - $this->element( 'language', $wgContLanguageCode ); |
| 71 | + $this->element( 'language', $wgLanguageCode ); |
72 | 72 | $this->element( 'type', 'Text' ); |
73 | 73 | $this->element( 'format', 'text/html' ); |
74 | 74 | $this->element( 'identifier', $this->reallyFullUrl() ); |
Index: trunk/phase3/includes/Preferences.php |
— | — | @@ -228,10 +228,10 @@ |
229 | 229 | } |
230 | 230 | |
231 | 231 | // Language |
232 | | - global $wgContLanguageCode; |
| 232 | + global $wgLanguageCode; |
233 | 233 | $languages = Language::getLanguageNames( false ); |
234 | | - if ( !array_key_exists( $wgContLanguageCode, $languages ) ) { |
235 | | - $languages[$wgContLanguageCode] = $wgContLanguageCode; |
| 234 | + if ( !array_key_exists( $wgLanguageCode, $languages ) ) { |
| 235 | + $languages[$wgLanguageCode] = $wgLanguageCode; |
236 | 236 | } |
237 | 237 | ksort( $languages ); |
238 | 238 | |
Index: trunk/phase3/includes/QueryPage.php |
— | — | @@ -532,10 +532,10 @@ |
533 | 533 | } |
534 | 534 | |
535 | 535 | function feedTitle() { |
536 | | - global $wgContLanguageCode, $wgSitename; |
| 536 | + global $wgLanguageCode, $wgSitename; |
537 | 537 | $page = SpecialPage::getPage( $this->getName() ); |
538 | 538 | $desc = $page->getDescription(); |
539 | | - return "$wgSitename - $desc [$wgContLanguageCode]"; |
| 539 | + return "$wgSitename - $desc [$wgLanguageCode]"; |
540 | 540 | } |
541 | 541 | |
542 | 542 | function feedDesc() { |