Compacting the interlanguage links with the ULS
Displays a shorter version of the language list with the languages that are more relevant to you. More info at https://www.mediawiki.org/wiki/Universal_Language_Selector/Design/Interlanguage_links Due to a problem with duplicate patchsets we had to create a new one. The history and info on code and security revisions is available at https://gerrit.wikimedia.org/r/#/c/104793/ Change-Id: I109bfb10f6181b6408aab170db5e8ca32493d657
This commit is contained in:
@@ -62,6 +62,13 @@ class UniversalLanguageSelectorHooks {
|
||||
// If the extension is enabled, basic features (API, language data) available.
|
||||
$out->addModules( 'ext.uls.init' );
|
||||
|
||||
// If compact ULS beta feature is enabled
|
||||
if ( class_exists( 'BetaFeatures' ) &&
|
||||
BetaFeatures::isFeatureEnabled( $out->getUser(), 'uls-compact-links' )
|
||||
) {
|
||||
$out->addModules( 'ext.uls.compactlinks' );
|
||||
}
|
||||
|
||||
if ( is_string( $wgULSGeoService ) ) {
|
||||
$out->addModules( 'ext.uls.geoclient' );
|
||||
}
|
||||
@@ -327,6 +334,20 @@ class UniversalLanguageSelectorHooks {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function onGetBetaFeaturePreferences( $user, &$prefs ) {
|
||||
global $wgExtensionAssetsPath;
|
||||
$prefs['uls-compact-links'] = array(
|
||||
'label-message' => 'uls-betafeature-label',
|
||||
'desc-message' => 'uls-betafeature-desc',
|
||||
'screenshot' => $wgExtensionAssetsPath .
|
||||
'/UniversalLanguageSelector/resources/images/compact-links-ltr.png',
|
||||
'info-link' =>
|
||||
'https://www.mediawiki.org/wiki/Universal_Language_Selector/Design/Interlanguage_links',
|
||||
'discussion-link' =>
|
||||
'https://www.mediawiki.org/wiki/Talk:Universal_Language_Selector/Design/Interlanguage_links',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook: SkinTemplateOutputPageBeforeExec
|
||||
* @param Skin $skin
|
||||
|
||||
Reference in New Issue
Block a user