First batch of files modified to switch wgLang to wgContLang.
authorZheng Zhu <zhengzhu@users.mediawiki.org>
Fri, 24 Sep 2004 13:14:52 +0000 (13:14 +0000)
committerZheng Zhu <zhengzhu@users.mediawiki.org>
Fri, 24 Sep 2004 13:14:52 +0000 (13:14 +0000)
15 files changed:
includes/Article.php
includes/CacheManager.php
includes/CategoryPage.php
includes/DifferenceEngine.php
includes/EditPage.php
includes/Feed.php
includes/ImageGallery.php
includes/ImagePage.php
includes/MagicWord.php
includes/Metadata.php
includes/OutputPage.php
includes/PageHistory.php
includes/Parser.php
includes/RawPage.php
includes/Setup.php

index 402ca81..7dc3727 100644 (file)
@@ -738,7 +738,7 @@ class Article {
         * the given title.
        */
        function view() {
-               global $wgUser, $wgOut, $wgLang, $wgRequest, $wgOnlySysopsCanPatrol;
+               global $wgUser, $wgOut, $wgRequest, $wgOnlySysopsCanPatrol;
                global $wgLinkCache, $IP, $wgEnableParserCache, $wgStylePath, $wgUseRCPatrol;
                $sk = $wgUser->getSkin();
 
@@ -1268,7 +1268,7 @@ class Article {
         * Add or remove this page to my watchlist based on value of $add
         */
        function watch( $add = true ) {
-               global $wgUser, $wgOut, $wgLang;
+               global $wgUser, $wgOut;
                global $wgDeferredUpdateList;
 
                if ( 0 == $wgUser->getID() ) {
@@ -1597,7 +1597,7 @@ class Article {
         * Perform a deletion and output success or failure messages
         */
        function doDelete( $reason ) {
-               global $wgOut, $wgUser, $wgLang;
+               global $wgOut, $wgUser, $wgContLang;
                $fname = 'Article::doDelete';
                wfDebug( $fname."\n" );
 
@@ -1608,8 +1608,8 @@ class Article {
                        $wgOut->setRobotpolicy( 'noindex,nofollow' );
 
                        $sk = $wgUser->getSkin();
-                       $loglink = $sk->makeKnownLink( $wgLang->getNsText( NS_PROJECT ) .
-                         ':' . wfMsg( 'dellogpage' ), wfMsg( 'deletionlog' ) );
+                       $loglink = $sk->makeKnownLink( $wgContLang->getNsText( NS_PROJECT ) .
+                         ':' . wfMsgForContent( 'dellogpage' ), wfMsg( 'deletionlog' ) );
 
                        $text = wfMsg( 'deletedtext', $deleted, $loglink );
 
@@ -1626,7 +1626,7 @@ class Article {
         * Returns success
         */
        function doDeleteArticle( $reason ) {
-               global $wgUser, $wgLang;
+               global $wgUser;
                global  $wgUseSquid, $wgDeferredUpdateList, $wgInternalServer;
 
                $fname = 'Article::doDeleteArticle';
@@ -1747,7 +1747,7 @@ class Article {
         * Revert a modification
         */
        function rollback() {
-               global $wgUser, $wgLang, $wgOut, $wgRequest;
+               global $wgUser, $wgOut, $wgRequest;
                $fname = 'Article::rollback';
 
                if ( ! $wgUser->isSysop() ) {
@@ -2160,7 +2160,7 @@ class Article {
         * Info about this page
         */
        function info() {
-               global $wgUser, $wgTitle, $wgOut, $wgLang, $wgAllowPageInfo;
+               global $wgUser, $wgTitle, $wgOut, $wgAllowPageInfo;
                $fname = 'Article::info';
 
                if ( !$wgAllowPageInfo ) {
index 1a5711b..ab6c66d 100644 (file)
@@ -31,11 +31,11 @@ class CacheManager {
        }
        
        function fileCacheName() {
-               global $wgFileCacheDirectory, $wgLang;
+               global $wgFileCacheDirectory, $wgContLang;
                if( !$this->mFileCache ) {
                        $hash = md5( $key = $this->mTitle->getDbkey() );
                        if( $this->mTitle->getNamespace() )
-                               $key = $wgLang->getNsText( $this->mTitle->getNamespace() ) . ":" . $key;
+                               $key = $wgContLang->getNsText( $this->mTitle->getNamespace() ) . ":" . $key;
                        $key = str_replace( '.', '%2E', urlencode( $key ) );
                        
                        $hash1 = substr( $hash, 0, 1 );
index 5070c1b..cd864e7 100644 (file)
@@ -50,7 +50,7 @@ class CategoryPage extends Article {
 
         # This method generates the list of subcategories and pages for a category
         function oldCategoryMagic () {
-                global $wgLang, $wgUser ;
+                global $wgContLang, $wgUser ;
                 $fname = 'CategoryPage::oldCategoryMagic';
 
 
@@ -73,7 +73,7 @@ class CategoryPage extends Article {
                 # For all pages that link to this category
                 while ( $x = $dbr->fetchObject ( $res ) )
                 {
-                        $t = $wgLang->getNsText ( $x->cur_namespace ) ;
+                        $t = $wgContLang->getNsText ( $x->cur_namespace ) ;
                         if ( $t != '' ) $t .= ':' ;
                         $t .= $x->cur_title ;
 
@@ -103,7 +103,7 @@ class CategoryPage extends Article {
        }
 
         function newCategoryMagic () {
-                global $wgLang,$wgUser;
+                global $wgContLang,$wgUser;
 
                $sk =& $wgUser->getSkin();
 
@@ -127,7 +127,7 @@ class CategoryPage extends Article {
                 $res = $dbr->query ( $sql ) ;
                 while ( $x = $dbr->fetchObject ( $res ) )
                 {
-                        $t = $ns = $wgLang->getNsText ( $x->cur_namespace ) ;
+                        $t = $ns = $wgContLang->getNsText ( $x->cur_namespace ) ;
                         if ( $t != '' ) $t .= ':' ;
                         $t .= $x->cur_title ;
 
@@ -140,13 +140,13 @@ class CategoryPage extends Article {
                                 // Workaround: If sortkey == "Category:".$title, than use $title for sorting,
                                 // else use sortkey...
                                 if ( ($ns.':'.$ctitle) == $x->cl_sortkey ) {
-                                        array_push ( $children_start_char, $wgLang->firstChar( $x->cur_title ) );
+                                        array_push ( $children_start_char, $wgContLang->firstChar( $x->cur_title ) );
                                 } else {
-                                        array_push ( $children_start_char, $wgLang->firstChar( $x->cl_sortkey ) ) ;
+                                        array_push ( $children_start_char, $wgContLang->firstChar( $x->cl_sortkey ) ) ;
                                 }
                         } else {
                                 array_push ( $articles , $sk->makeKnownLink ( $t ) ) ; # Page in this category
-                                array_push ( $articles_start_char, $wgLang->firstChar( $x->cl_sortkey ) ) ;
+                                array_push ( $articles_start_char, $wgContLang->firstChar( $x->cl_sortkey ) ) ;
                         }
                 }
                 $dbr->freeResult ( $res ) ;
index 52bf654..198c9b3 100644 (file)
@@ -58,7 +58,7 @@ class DifferenceEngine {
 
        function showDiffPage()
        {
-               global $wgUser, $wgTitle, $wgOut, $wgLang, $wgOnlySysopsCanPatrol, $wgUseRCPatrol;
+               global $wgUser, $wgTitle, $wgOut, $wgContLang, $wgOnlySysopsCanPatrol, $wgUseRCPatrol;
                $fname = 'DifferenceEngine::showDiffPage';
                wfProfileIn( $fname );
 
@@ -102,7 +102,7 @@ class DifferenceEngine {
                }
 
                $sk = $wgUser->getSkin();
-               $talk = $wgLang->getNsText( NS_TALK );
+               $talk = $wgContLang->getNsText( NS_TALK );
                $contribs = wfMsg( 'contribslink' );
 
                $this->mOldComment = $sk->formatComment($this->mOldComment);
index 1fb7925..67ea7ca 100644 (file)
@@ -122,7 +122,7 @@ class EditPage {
         */
        function editForm( $formtype ) {
                global $wgOut, $wgUser;
-               global $wgLang, $wgParser, $wgTitle;
+               global $wgLang, $wgContLang, $wgParser, $wgTitle;
                global $wgAllowAnonymousMinor;
                global $wgWhitelistEdit;
                global $wgSpamRegex, $wgFilterCallback;
@@ -430,7 +430,7 @@ class EditPage {
 
                # if this is a comment, show a subject line at the top, which is also the edit summary.
                # Otherwise, show a summary field at the bottom
-               $summarytext = htmlspecialchars( $wgLang->recodeForEdit( $this->summary ) ); # FIXME
+               $summarytext = htmlspecialchars( $wgContLang->recodeForEdit( $this->summary ) ); # FIXME
                        if( $this->section == 'new' ) {
                                $commentsubject="{$subject}: <input tabindex='1' type='text' value=\"$summarytext\" name=\"wpSummary\" maxlength='200' size='60' /><br />";
                                $editsummary = '';
@@ -470,7 +470,7 @@ enctype=\"application/x-www-form-urlencoded\">
 {$commentsubject}
 <textarea tabindex='1' accesskey=\",\" name=\"wpTextbox1\" rows='{$rows}'
 cols='{$cols}'{$ew}>" .
-htmlspecialchars( $wgLang->recodeForEdit( $this->textbox1 ) ) .
+htmlspecialchars( $wgContLang->recodeForEdit( $this->textbox1 ) ) .
 "
 </textarea>
 <br />{$editsummary}
@@ -493,7 +493,7 @@ htmlspecialchars( $wgLang->recodeForEdit( $this->textbox1 ) ) .
 
                        $wgOut->addHTML( "<h2>" . wfMsg( "yourtext" ) . "</h2>
 <textarea tabindex=6 id='wpTextbox2' name=\"wpTextbox2\" rows='{$rows}' cols='{$cols}' wrap='virtual'>"
-. htmlspecialchars( $wgLang->recodeForEdit( $this->textbox2 ) ) .
+. htmlspecialchars( $wgContLang->recodeForEdit( $this->textbox2 ) ) .
 "
 </textarea>" );
                }
@@ -508,7 +508,7 @@ htmlspecialchars( $wgLang->recodeForEdit( $this->textbox1 ) ) .
         * @todo document
         */
        function blockedIPpage() {
-               global $wgOut, $wgUser, $wgLang, $wgIP;
+               global $wgOut, $wgUser, $wgContLang, $wgIP;
 
                $wgOut->setPageTitle( wfMsg( 'blockedtitle' ) );
                $wgOut->setRobotpolicy( 'noindex,nofollow' );
@@ -523,7 +523,7 @@ htmlspecialchars( $wgLang->recodeForEdit( $this->textbox1 ) ) .
                } else {
                        $name = $id;
                }
-               $link = '[[' . $wgLang->getNsText( Namespace::getUser() ) .
+               $link = '[[' . $wgContLang->getNsText( Namespace::getUser() ) .
                  ":{$name}|{$name}]]";
 
                $wgOut->addWikiText( wfMsg( 'blockedtext', $link, $reason, $ip, $name ) );
@@ -534,7 +534,7 @@ htmlspecialchars( $wgLang->recodeForEdit( $this->textbox1 ) ) .
         * @todo document
         */
        function userNotLoggedInPage() {
-               global $wgOut, $wgUser, $wgLang;
+               global $wgOut, $wgUser;
 
                $wgOut->setPageTitle( wfMsg( 'whitelistedittitle' ) );
                $wgOut->setRobotpolicy( 'noindex,nofollow' );
index f154c86..3ac7fe3 100644 (file)
@@ -60,10 +60,10 @@ class FeedItem {
         * @todo document
         */
        function xmlEncode( $string ) {
-               global $wgInputEncoding, $wgLang;
+               global $wgInputEncoding, $wgContLang;
                $string = str_replace( "\r\n", "\n", $string );
                if( strcasecmp( $wgInputEncoding, 'utf-8' ) != 0 ) {
-                       $string = $wgLang->iconv( $wgInputEncoding, 'utf-8', $string );
+                       $string = $wgContLang->iconv( $wgInputEncoding, 'utf-8', $string );
                }
                return htmlspecialchars( $string );
        }
@@ -84,8 +84,8 @@ class FeedItem {
         * @todo document
         */
        function getLanguage() {
-               global $wgLanguageCode;
-               return $wgLanguageCode;
+               global $wgContLanguageCode;
+               return $wgContLanguageCode;
        }
        /**
         * @todo document
index d438428..d29cf0d 100644 (file)
@@ -27,7 +27,7 @@ class ImageGallery
        }
 
        function toHTML() {
-               global $wgLang, $wgUser;
+               global $wgLang, $wgContLang, $wgUser;
 
                $sk = $wgUser->getSkin();
 
@@ -41,7 +41,7 @@ class ImageGallery
                        $nt = $img->getTitle();
 
                        //TODO
-                       //$ul = $sk->makeLink( $wgLang->getNsText( Namespace::getUser() ) . ":{$ut}", $ut );
+                       //$ul = $sk->makeLink( $wgContLang->getNsText( Namespace::getUser() ) . ":{$ut}", $ut );
 
                        $ilink = '<a href="' . $img->getURL() .  '">' . $nt->getText() . '</a>';
                        $nb = wfMsg( "nbytes", $wgLang->formatNum( $img->getSize() ) );
index c717ce5..1668197 100644 (file)
@@ -192,7 +192,7 @@ class ImagePage extends Article {
 
        function doDelete()
        {
-               global $wgOut, $wgUser, $wgLang, $wgRequest;
+               global $wgOut, $wgUser, $wgContLang, $wgRequest;
                global $wgUseSquid, $wgInternalServer, $wgDeferredUpdateList;
                $fname = 'ImagePage::doDelete';
 
@@ -253,7 +253,7 @@ class ImagePage extends Article {
                        # Image itself is now gone, and database is cleaned.
                        # Now we remove the image description page.
 
-                       $nt = Title::newFromText( $wgLang->getNsText( Namespace::getImage() ) . ":" . $image );
+                       $nt = Title::newFromText( $wgContLang->getNsText( Namespace::getImage() ) . ":" . $image );
                        $article = new Article( $nt );
                        $article->doDeleteArticle( $reason ); # ignore errors
 
@@ -264,7 +264,7 @@ class ImagePage extends Article {
                $wgOut->setRobotpolicy( 'noindex,nofollow' );
 
                $sk = $wgUser->getSkin();
-               $loglink = $sk->makeKnownLink( $wgLang->getNsText(
+               $loglink = $sk->makeKnownLink( $wgContLang->getNsText(
                  Namespace::getWikipedia() ) .
                  ':' . wfMsg( 'dellogpage' ), wfMsg( 'deletionlog' ) );
 
index 0508f96..4651ba8 100644 (file)
@@ -116,9 +116,9 @@ class MagicWord {
        
        # Initialises this object with an ID
        function load( $id ) {
-               global $wgLang;         
+               global $wgContLang;             
                $this->mId = $id;
-               $wgLang->getMagic( $this );
+               $wgContLang->getMagic( $this );
        }
        
        /**
index 4b1c6bc..57768b7 100644 (file)
@@ -117,11 +117,11 @@ function dcEpilogue() {
  * @private
  */
 function dcBasics($article) {
-       global $wgLanguageCode, $wgSitename;
+       global $wgContLanguageCode, $wgSitename;
        
        dcElement('title', $article->mTitle->getText());
        dcPageOrString('publisher', wfMsg('aboutpage'), $wgSitename);
-       dcElement('language', $wgLanguageCode);
+       dcElement('language', $wgContLanguageCode);
        dcElement('type', 'Text');
        dcElement('format', 'text/html');
        dcElement('identifier', dcReallyFullUrl($article->mTitle));
@@ -271,7 +271,7 @@ function dcUrl($name, $url) {
  * @private
  */
 function dcPerson($name, $id, $user_name='', $user_real_name='') {
-       global $wgLang;
+       global $wgContLang;
 
        if ($id == 0) {
                dcElement($name, wfMsg('anonymous'));
@@ -282,7 +282,7 @@ function dcPerson($name, $id, $user_name='', $user_real_name='') {
                if( empty( $user_name ) ) {
                        $user_name = User::whoIs($id);
                }
-               dcPageOrString($name, $wgLang->getNsText(NS_USER) . ':' . $user_name, wfMsg('siteuser', $user_name));
+               dcPageOrString($name, $wgContLang->getNsText(NS_USER) . ':' . $user_name, wfMsg('siteuser', $user_name));
        }
 }
 
index dcfe19f..3f21307 100644 (file)
@@ -407,11 +407,11 @@ class OutputPage {
        }
 
        function out( $ins ) {
-               global $wgInputEncoding, $wgOutputEncoding, $wgLang;
+               global $wgInputEncoding, $wgOutputEncoding, $wgContLang;
                if ( 0 == strcmp( $wgInputEncoding, $wgOutputEncoding ) ) {
                        $outs = $ins;
                } else {
-                       $outs = $wgLang->iconv( $wgInputEncoding, $wgOutputEncoding, $ins );
+                       $outs = $wgContLang->iconv( $wgInputEncoding, $wgOutputEncoding, $ins );
                        if ( false === $outs ) { $outs = $ins; }
                }
                print $outs;
@@ -419,12 +419,12 @@ class OutputPage {
 
        function setEncodings() {
                global $wgInputEncoding, $wgOutputEncoding;
-               global $wgUser, $wgLang;
+               global $wgUser, $wgContLang;
 
                $wgInputEncoding = strtolower( $wgInputEncoding );
 
                if( $wgUser->getOption( 'altencoding' ) ) {
-                       $wgLang->setAltEncoding();
+                       $wgContLang->setAltEncoding();
                        return;
                }
 
@@ -550,7 +550,7 @@ class OutputPage {
        }
 
        function loginToUse() {
-               global $wgUser, $wgTitle, $wgLang;
+               global $wgUser, $wgTitle, $wgContLang;
 
                $this->setPageTitle( wfMsg( 'loginreqtitle' ) );
                $this->setHTMLTitle( wfMsg( 'errorpagetitle' ) );
@@ -562,7 +562,7 @@ class OutputPage {
                # We put a comment in the .html file so a Sysop can diagnose the page the
                # user can't see.
                $this->addHTML( "\n<!--" .
-                                               $wgLang->getNsText( $wgTitle->getNamespace() ) .
+                                               $wgContLang->getNsText( $wgTitle->getNamespace() ) .
                                                ':' .
                                                $wgTitle->getDBkey() . '-->' );
                $this->returnToMain();          # Flip back to the main page after 10 seconds.
@@ -705,8 +705,8 @@ class OutputPage {
         * @private
         */
        function headElement() {
-               global $wgDocType, $wgDTD, $wgLanguageCode, $wgOutputEncoding, $wgMimeType;
-               global $wgUser, $wgLang, $wgRequest;
+               global $wgDocType, $wgDTD, $wgContLanguageCode, $wgOutputEncoding, $wgMimeType;
+               global $wgUser, $wgContLang, $wgRequest;
 
                $xml = ($wgMimeType == 'text/xml');
                if( $xml ) {
@@ -725,8 +725,8 @@ class OutputPage {
                } else {
                        $xmlbits = '';
                }
-               $rtl = $wgLang->isRTL() ? " dir='RTL'" : '';
-               $ret .= "<html $xmlbits lang=\"$wgLanguageCode\" $rtl>\n";
+               $rtl = $wgContLang->isRTL() ? " dir='RTL'" : '';
+               $ret .= "<html $xmlbits lang=\"$wgContLanguageCode\" $rtl>\n";
                $ret .= "<head>\n<title>" . htmlspecialchars( $this->mHTMLtitle ) . "</title>\n";
                array_push( $this->mMetatags, array( "http:Content-type", "$wgMimeType; charset={$wgOutputEncoding}" ) );
 
index 2bc77a8..f0c8a8a 100644 (file)
@@ -144,7 +144,7 @@ class PageHistory {
        }
 
        function historyLine( $ts, $u, $ut, $ns, $ttl, $oid, $c, $isminor, $counter = '' ) {
-               global $wgLang;
+               global $wgLang, $wgContLang;
 
                $artname = Title::makeName( $ns, $ttl );
                $last = wfMsg( 'last' );
@@ -167,10 +167,10 @@ class PageHistory {
                $link = $this->mSkin->makeKnownLink( $artname, $dt, $q );
 
                if ( 0 == $u ) {
-                       $ul = $this->mSkin->makeKnownLink( $wgLang->specialPage( 'Contributions' ),
+                       $ul = $this->mSkin->makeKnownLink( $wgContLang->specialPage( 'Contributions' ),
                                htmlspecialchars( $ut ), 'target=' . urlencode( $ut ) );
                } else {
-                       $ul = $this->mSkin->makeLink( $wgLang->getNsText(
+                       $ul = $this->mSkin->makeLink( $wgContLang->getNsText(
                                Namespace::getUser() ) . ':'.$ut , htmlspecialchars( $ut ) );
                }
 
index 999250c..c575cda 100644 (file)
@@ -1060,7 +1060,7 @@ class Parser
         * @access private
         */
        function replaceInternalLinks( $s ) {
-               global $wgLang, $wgLinkCache;
+               global $wgLang, $wgContLang, $wgLinkCache;
                global $wgNamespacesWithSubpages;
                static $fname = 'Parser::replaceInternalLinks' ;
                wfProfileIn( $fname );
@@ -1084,7 +1084,7 @@ class Parser
                # e.g. in the case of 'The Arab al[[Razi]]', 'al' will be matched
                static $e2 = '/^(.*?)([a-zA-Z\x80-\xff]+)$/sD';
 
-               $useLinkPrefixExtension = $wgLang->linkPrefixExtension();
+               $useLinkPrefixExtension = $wgContLang->linkPrefixExtension();
                # Special and Media are pseudo-namespaces; no pages actually exist in them
 
                $nottalk = !Namespace::isTalk( $this->mTitle->getNamespace() );
@@ -1185,7 +1185,7 @@ class Parser
                        if( $noforce ) {
 
                                # Interwikis
-                               if( $iw && $this->mOptions->getInterwikiMagic() && $nottalk && $wgLang->getLanguageName( $iw ) ) {
+                               if( $iw && $this->mOptions->getInterwikiMagic() && $nottalk && $wgContLang->getLanguageName( $iw ) ) {
                                        array_push( $this->mOutput->mLanguageLinks, $nt->getFullText() );
                                        $tmp = $prefix . $trail ;
                                        $s .= (trim($tmp) == '')? '': $tmp;
@@ -1492,32 +1492,32 @@ class Parser
         * @access private
         */
        function getVariableValue( $index ) {
-               global $wgLang, $wgSitename, $wgServer;
+               global $wgContLang, $wgSitename, $wgServer;
 
                switch ( $index ) {
                        case MAG_CURRENTMONTH:
-                               return $wgLang->formatNum( date( 'm' ) );
+                               return $wgContLang->formatNum( date( 'm' ) );
                        case MAG_CURRENTMONTHNAME:
-                               return $wgLang->getMonthName( date('n') );
+                               return $wgContLang->getMonthName( date('n') );
                        case MAG_CURRENTMONTHNAMEGEN:
-                               return $wgLang->getMonthNameGen( date('n') );
+                               return $wgContLang->getMonthNameGen( date('n') );
                        case MAG_CURRENTDAY:
-                               return $wgLang->formatNum( date('j') );
+                               return $wgContLang->formatNum( date('j') );
                        case MAG_PAGENAME:
                                return $this->mTitle->getText();
                        case MAG_PAGENAMEE:
                                return $this->mTitle->getPartialURL();
                        case MAG_NAMESPACE:
                                # return Namespace::getCanonicalName($this->mTitle->getNamespace());
-                               return $wgLang->getNsText($this->mTitle->getNamespace()); # Patch by Dori
+                               return $wgContLang->getNsText($this->mTitle->getNamespace()); # Patch by Dori
                        case MAG_CURRENTDAYNAME:
-                               return $wgLang->getWeekdayName( date('w')+1 );
+                               return $wgContLang->getWeekdayName( date('w')+1 );
                        case MAG_CURRENTYEAR:
-                               return $wgLang->formatNum( date( 'Y' ) );
+                               return $wgContLang->formatNum( date( 'Y' ) );
                        case MAG_CURRENTTIME:
-                               return $wgLang->time( wfTimestampNow(), false );
+                               return $wgContLang->time( wfTimestampNow(), false );
                        case MAG_NUMBEROFARTICLES:
-                               return $wgLang->formatNum( wfNumberOfArticles() );
+                               return $wgContLang->formatNum( wfNumberOfArticles() );
                        case MAG_SITENAME:
                                return $wgSitename;
                        case MAG_SERVER:
@@ -1653,7 +1653,7 @@ class Parser
         * @access private
         */
        function braceSubstitution( $matches ) {
-               global $wgLinkCache, $wgLang;
+               global $wgLinkCache, $wgContLang;
                $fname = 'Parser::braceSubstitution';
                $found = false;
                $nowiki = false;
@@ -1720,12 +1720,12 @@ class Parser
                        $mwNs = MagicWord::get( MAG_NS );
                        if ( $mwNs->matchStartAndRemove( $part1 ) ) {
                                if ( intval( $part1 ) ) {
-                                       $text = $wgLang->getNsText( intval( $part1 ) );
+                                       $text = $wgContLang->getNsText( intval( $part1 ) );
                                        $found = true;
                                } else {
                                        $index = Namespace::getCanonicalIndex( strtolower( $part1 ) );
                                        if ( !is_null( $index ) ) {
-                                               $text = $wgLang->getNsText( $index );
+                                               $text = $wgContLang->getNsText( $index );
                                                $found = true;
                                        }
                                }
@@ -1762,7 +1762,7 @@ class Parser
                if ( !$found && $argc == 1 ) {
                        $mwGrammar =& MagicWord::get( MAG_GRAMMAR );
                        if ( $mwGrammar->matchStartAndRemove( $part1 ) ) {
-                               $text = $wgLang->convertGrammar( $args[0], $part1 );
+                               $text = $wgContLang->convertGrammar( $args[0], $part1 );
                                $found = true;
                        }
                }
@@ -2090,7 +2090,7 @@ class Parser
         * @access private
         */
        /* private */ function formatHeadings( $text, $isMain=true ) {
-               global $wgInputEncoding, $wgMaxTocLevel, $wgLang, $wgLinkHolders;
+               global $wgInputEncoding, $wgMaxTocLevel, $wgContLang, $wgLinkHolders;
 
                $doNumberHeadings = $this->mOptions->getNumberHeadings();
                $doShowToc = $this->mOptions->getShowToc();
@@ -2201,7 +2201,7 @@ class Parser
                                                if( $dot ) {
                                                        $numbering .= '.';
                                                }
-                                               $numbering .= $wgLang->formatNum( $sublevelCount[$i] );
+                                               $numbering .= $wgContLang->formatNum( $sublevelCount[$i] );
                                                $dot = 1;
                                        }
                                }
@@ -2528,7 +2528,7 @@ class Parser
         * @access private
         */
        function pstPass2( $text, &$user ) {
-               global $wgLang, $wgLocaltimezone, $wgCurParser;
+               global $wgLang, $wgContLang, $wgLocaltimezone, $wgCurParser;
 
                # Variable replacement
                # Because mOutputType is OT_WIKI, this will only process {{subst:xxx}} type tags
@@ -2543,13 +2543,13 @@ class Parser
                        $oldtz = getenv('TZ'); putenv('TZ='.$wgLocaltimezone);
                }
                /* Note: this is an ugly timezone hack for the European wikis */
-               $d = $wgLang->timeanddate( date( 'YmdHis' ), false ) .
+               $d = $wgContLang->timeanddate( date( 'YmdHis' ), false ) .
                  ' (' . date( 'T' ) . ')';
                if(isset($wgLocaltimezone)) putenv('TZ='.$oldtzs);
 
                $text = preg_replace( '/~~~~~/', $d, $text );
-               $text = preg_replace( '/~~~~/', '[[' . $wgLang->getNsText( NS_USER ) . ":$n|$k]] $d", $text );
-               $text = preg_replace( '/~~~/', '[[' . $wgLang->getNsText( NS_USER ) . ":$n|$k]]", $text );
+               $text = preg_replace( '/~~~~/', '[[' . $wgContLang->getNsText( NS_USER ) . ":$n|$k]] $d", $text );
+               $text = preg_replace( '/~~~/', '[[' . $wgContLang->getNsText( NS_USER ) . ":$n|$k]]", $text );
 
                # Context links: [[|name]] and [[name (context)|]]
                #
index 2688645..66a6305 100644 (file)
@@ -70,7 +70,7 @@ class RawPage {
        }
        
        function getrawtext () {
-               global $wgInputEncoding, $wgLang;
+               global $wgInputEncoding, $wgContLang;
                $fname = 'RawPage::getrawtext';
                
                if( !$this->mTitle ) return '';
@@ -83,7 +83,7 @@ class RawPage {
                if($ns == NS_MEDIAWIKI) {
                        $rawtext = wfMsg($t);
                        if($wgInputEncoding != $this->mCharset)
-                       $rawtext = $wgLang->iconv( $wgInputEncoding, $this->mCharset, $rawtext );
+                       $rawtext = $wgContLang->iconv( $wgInputEncoding, $this->mCharset, $rawtext );
                        return $rawtext;
                }
                # else get it from the DB
@@ -100,7 +100,7 @@ class RawPage {
                if( $s = $dbr->fetchObject( $res ) ) {
                        $rawtext = Article::getRevisionText( $s, "" );
                        if($wgInputEncoding != $this->mCharset)
-                       $rawtext = $wgLang->iconv( $wgInputEncoding, $this->mCharset, $rawtext );
+                       $rawtext = $wgContLang->iconv( $wgInputEncoding, $this->mCharset, $rawtext );
                        header( 'Last-modified: '.gmdate( "D, j M Y H:i:s", wfTimestamp2Unix( $s->timestamp )).' GMT' );
                        return $rawtext;
                } else {
index 2ef0b47..c9a8f50 100644 (file)
@@ -223,28 +223,28 @@ wfProfileOut( $fname.'-User' );
 wfProfileIn( $fname.'-language' );
 
 function setupLangObj(&$langclass, $langcode) {
-    global $wgUseLatin1;
+       global $wgUseLatin1;
 
 
-    if( ! class_exists( $langclass ) || ($langcode == 'en' && !$wgUseLatin1) ) {
+       if( ! class_exists( $langclass ) || ($langcode == 'en' && !$wgUseLatin1) ) {
 # Default to English/UTF-8
-        require_once( 'languages/LanguageUtf8.php' );
-        $langclass = 'LanguageUtf8';
-    }
+               require_once( 'languages/LanguageUtf8.php' );
+               $langclass = 'LanguageUtf8';
+       }
 
-    $lang = new $langclass();
-    if ( !is_object($lang) ) {
-        print "No language class ($wgLang)\N";
-    }
+       $lang = new $langclass();
+       if ( !is_object($lang) ) {
+               print "No language class ($wgLang)\N";
+       }
 
-    if( $wgUseLatin1 && $langcode != 'en' ) {
+       if( $wgUseLatin1 && $langcode != 'en' ) {
 # For non-UTF-8 non-English.
-        require_once( 'languages/LanguageLatin1.php' );
-        $xxx = new LanguageLatin1( $lang );
-        unset( $lang );
-        $lang = $xxx;
-    }
-    return $lang;
+               require_once( 'languages/LanguageLatin1.php' );
+               $xxx = new LanguageLatin1( $lang );
+               unset( $lang );
+               $lang = $xxx;
+       }
+       return $lang;
 }
 
 require_once( 'languages/Language.php' );
@@ -261,13 +261,13 @@ if(!$wgUser->mDataLoaded) { $wgUser->loadDefaultFromLanguage(); }
 $wgLanguageCode = $wgUser->getOption('language');
 
 $wgLangClass = 'Language'. str_replace( '-', '_', ucfirst( $wgLanguageCode ) );
- if($wgLangClass == $wgContLangClass) {
-     $wgLang = &$wgContLang;
- }
- else {
-     include_once("languages/$wgLangClass.php");
-     $wgLang = setupLangObj($wgLangClass, $wgLanguageCode);
- }
+if($wgLangClass == $wgContLangClass) {
+       $wgLang = &$wgContLang;
+}
+else {
+       include_once("languages/$wgLangClass.php");
+       $wgLang = setupLangObj($wgLangClass, $wgLanguageCode);
+}
 
 
 wfProfileOut( $fname.'-language' );
@@ -276,11 +276,11 @@ wfProfileIn( $fname.'-MessageCache' );
 $wgContMessageCache = new MessageCache;
 $wgContMessageCache->initialise( $messageMemc, $wgUseDatabaseMessages, $wgMsgCacheExpiry, $wgDBname, $wgContLang, $wgContLanguageCode );
 if($wgLangClass == $wgContLangClass) {
-    $wgMessageCache = &$wgContMessageCache;
+       $wgMessageCache = &$wgContMessageCache;
 }
 else {
-    $wgMessageCache = new MessageCache;
-    $wgMessageCache->initialise( $messageMemc,false , $wgMsgCacheExpiry, $wgDBname.":$wgLangClass", $wgLang, $wgLanguageCode);
+       $wgMessageCache = new MessageCache;
+       $wgMessageCache->initialise( $messageMemc,false , $wgMsgCacheExpiry, $wgDBname.":$wgLangClass", $wgLang, $wgLanguageCode);
 }
 
 wfProfileOut( $fname.'-MessageCache' );
@@ -300,6 +300,13 @@ wfProfileOut( $fname.'-MessageCache' );
 # $wgLang = $wgContLang;
 # $wgMessageCache = $wgContMessageCache;
 #
+# TODO: Need to change reference to $wgLang to $wgContLang at proper 
+#       places, including namespaces, dates in signatures, magic words,
+#       and links
+#
+# TODO: Need to look at the issue of input/output encoding
+#
+
 
 wfProfileIn( $fname.'-OutputPage' );