Remove last bits of MediaWiki 1.19 compatibility
Compatibility with MediaWiki 1.19 had already been dropped and this hadn't been removed yet. Change-Id: I63788ef1d4a6eb87e4280ea2625579a7874eaff8
This commit is contained in:
@@ -36,14 +36,9 @@ class ResourceLoaderULSModule extends ResourceLoaderModule {
|
|||||||
*/
|
*/
|
||||||
protected function getData() {
|
protected function getData() {
|
||||||
$vars = array();
|
$vars = array();
|
||||||
if ( method_exists( 'Language', 'fetchLanguageNames' ) ) {
|
$vars['wgULSLanguages'] = Language::fetchLanguageNames(
|
||||||
// since 1.20
|
$this->language->getCode(), 'mwfile'
|
||||||
$vars['wgULSLanguages'] = Language::fetchLanguageNames(
|
);
|
||||||
$this->language->getCode(), 'mwfile'
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$vars['wgULSLanguages'] = Language::getLanguageNames( false );
|
|
||||||
}
|
|
||||||
|
|
||||||
return $vars;
|
return $vars;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ class UniversalLanguageSelectorHooks {
|
|||||||
$lang = $context->getLanguage();
|
$lang = $context->getLanguage();
|
||||||
$personal_urls = array(
|
$personal_urls = array(
|
||||||
'uls' => array(
|
'uls' => array(
|
||||||
'text' => $lang->getLanguageName( $lang->getCode() ),
|
'text' => $lang->fetchLanguageName( $lang->getCode() ),
|
||||||
'href' => '#',
|
'href' => '#',
|
||||||
'class' => 'uls-trigger',
|
'class' => 'uls-trigger',
|
||||||
'active' => true
|
'active' => true
|
||||||
@@ -113,11 +113,7 @@ class UniversalLanguageSelectorHooks {
|
|||||||
|
|
||||||
protected static function isSupportedLanguage( $language ) {
|
protected static function isSupportedLanguage( $language ) {
|
||||||
wfProfileIn( __METHOD__ );
|
wfProfileIn( __METHOD__ );
|
||||||
if ( method_exists( 'Language', 'fetchLanguageNames' ) ) {
|
$supported = Language::fetchLanguageNames( null, 'mwfile' ); // since 1.20
|
||||||
$supported = Language::fetchLanguageNames( null, 'mwfile' ); // since 1.20
|
|
||||||
} else {
|
|
||||||
$supported = Language::getLanguageNames( false );
|
|
||||||
}
|
|
||||||
wfProfileOut( __METHOD__ );
|
wfProfileOut( __METHOD__ );
|
||||||
|
|
||||||
return isset( $supported[$language] );
|
return isset( $supported[$language] );
|
||||||
@@ -129,11 +125,8 @@ class UniversalLanguageSelectorHooks {
|
|||||||
*/
|
*/
|
||||||
protected static function getDefaultLanguage( array $preferred ) {
|
protected static function getDefaultLanguage( array $preferred ) {
|
||||||
wfProfileIn( __METHOD__ );
|
wfProfileIn( __METHOD__ );
|
||||||
if ( method_exists( 'Language', 'fetchLanguageNames' ) ) {
|
$supported = Language::fetchLanguageNames( null, 'mwfile' ); // since 1.20
|
||||||
$supported = Language::fetchLanguageNames( null, 'mwfile' ); // since 1.20
|
|
||||||
} else {
|
|
||||||
$supported = Language::getLanguageNames( false );
|
|
||||||
}
|
|
||||||
// look for a language that is acceptable to the client
|
// look for a language that is acceptable to the client
|
||||||
// and known to the wiki.
|
// and known to the wiki.
|
||||||
foreach ( $preferred as $code => $weight ) {
|
foreach ( $preferred as $code => $weight ) {
|
||||||
|
|||||||
@@ -33,11 +33,7 @@ class LanguageNameIndexer extends Maintenance {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function execute() {
|
public function execute() {
|
||||||
if ( method_exists( 'Language', 'fetchLanguageNames' ) ) {
|
$languages = Language::fetchLanguageNames( null, 'all' ); // since 1.20
|
||||||
$languages = Language::fetchLanguageNames( null, 'all' ); // since 1.20
|
|
||||||
} else {
|
|
||||||
$languages = Language::getLanguageNames( false );
|
|
||||||
}
|
|
||||||
|
|
||||||
$all = array();
|
$all = array();
|
||||||
$buckets = array();
|
$buckets = array();
|
||||||
|
|||||||
Reference in New Issue
Block a user