Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/MobileFrontend.body.php |
— | — | @@ -269,10 +269,19 @@ |
270 | 270 | |
271 | 271 | $languageUrls = array(); |
272 | 272 | |
| 273 | + /** |
| 274 | + * Provide correct method name depending on MW 1.19 or MW 1.20 |
| 275 | + */ |
| 276 | + if ( method_exists( 'Language', 'fetchLanguageName' )) { |
| 277 | + $langFetchMethodName = 'fetchLanguageName'; |
| 278 | + } else { |
| 279 | + $langFetchMethodName = 'getLanguageName'; |
| 280 | + } |
| 281 | + |
273 | 282 | $languageUrls[] = array( |
274 | 283 | 'href' => self::$currentURL, |
275 | 284 | 'text' => self::$htmlTitle, |
276 | | - 'language' => Language::fetchLanguageName( $wgLanguageCode ), |
| 285 | + 'language' => Language::$langFetchMethodName( $wgLanguageCode ), |
277 | 286 | 'class' => 'interwiki-' . $wgLanguageCode, |
278 | 287 | 'lang' => $wgLanguageCode, |
279 | 288 | ); |
— | — | @@ -287,10 +296,10 @@ |
288 | 297 | $languageUrl = $this->getMobileUrl( $nt->getFullURL() ); |
289 | 298 | $languageUrls[] = array( |
290 | 299 | 'href' => $languageUrl, |
291 | | - 'text' => ( Language::fetchLanguageName( $nt->getInterwiki() ) != '' |
292 | | - ? Language::fetchLanguageName( $nt->getInterwiki() ) |
| 300 | + 'text' => ( Language::$langFetchMethodName( $nt->getInterwiki() ) != '' |
| 301 | + ? Lanuage::$langFetchMethodName( $nt->getInterwiki() ) |
293 | 302 | : $l ), |
294 | | - 'language' => Language::fetchLanguageName( $lang ), |
| 303 | + 'language' => Language::$langFetchMethodName( $lang ), |
295 | 304 | 'class' => $class, |
296 | 305 | 'lang' => $lang, |
297 | 306 | ); |