Index: trunk/phase3/includes/StubObject.php |
— | — | @@ -146,24 +146,6 @@ |
147 | 147 | } |
148 | 148 | |
149 | 149 | function _newObject() { |
150 | | - global $wgLanguageCode, $wgRequest, $wgUser, $wgContLang; |
151 | | - $code = $wgRequest->getVal( 'uselang', $wgUser->getOption( 'language' ) ); |
152 | | - // BCP 47 - letter case MUST NOT carry meaning |
153 | | - $code = strtolower( $code ); |
154 | | - |
155 | | - # Validate $code |
156 | | - if( empty( $code ) || !Language::isValidCode( $code ) || ( $code === 'qqq' ) ) { |
157 | | - wfDebug( "Invalid user language code\n" ); |
158 | | - $code = $wgLanguageCode; |
159 | | - } |
160 | | - |
161 | | - wfRunHooks( 'UserGetLanguageObject', array( $wgUser, &$code ) ); |
162 | | - |
163 | | - if( $code === $wgLanguageCode ) { |
164 | | - return $wgContLang; |
165 | | - } else { |
166 | | - $obj = Language::factory( $code ); |
167 | | - return $obj; |
168 | | - } |
| 150 | + return RequestContext::getMain()->lang; |
169 | 151 | } |
170 | 152 | } |