Add backward compatibility for fetchLanguageNames

Bug: 46737
Change-Id: Ife7c2834c2b2c4f2619b4a5d8e0b0aa1db595984
This commit is contained in:
Amir E. Aharoni
2013-04-30 13:33:28 +03:00
parent 4b5283182e
commit c9a5ec7f19
3 changed files with 25 additions and 6 deletions

View File

@@ -33,9 +33,15 @@ class ResourceLoaderULSModule extends ResourceLoaderModule {
*/
protected function getData() {
$vars = array();
$vars['wgULSLanguages'] = Language::fetchLanguageNames(
$this->language->getCode(), 'mwfile'
);
if ( method_exists( 'Language', 'fetchLanguageNames' ) ) {
// since 1.20
$vars['wgULSLanguages'] = Language::fetchLanguageNames(
$this->language->getCode(), 'mwfile'
);
} else {
$vars['wgULSLanguages'] = Language::getLanguageNames( false );
}
return $vars;
}