Introduce a preference to disable compact language links
Bug: T133030 Change-Id: If9ec0b8c75c59c62991f0d4bfa99f6d4c9324c30
This commit is contained in:
committed by
Niklas Laxström
parent
49bf8000e3
commit
f1995bc603
@@ -75,7 +75,8 @@ class UniversalLanguageSelectorHooks {
|
||||
|
||||
if ( $wgULSCompactLanguageLinksBetaFeature === false ) {
|
||||
// Compact language links is a default feature in this wiki.
|
||||
return true;
|
||||
// Check user preference
|
||||
return $user->getBoolOption( 'compact-language-links' );
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -340,6 +341,8 @@ class UniversalLanguageSelectorHooks {
|
||||
}
|
||||
|
||||
public static function onGetPreferences( $user, &$preferences ) {
|
||||
global $wgULSCompactLanguageLinksBetaFeature;
|
||||
|
||||
$preferences['uls-preferences'] = [
|
||||
'type' => 'api',
|
||||
];
|
||||
@@ -354,6 +357,14 @@ class UniversalLanguageSelectorHooks {
|
||||
// showing the link when javascript is disabled.
|
||||
];
|
||||
|
||||
if ( $wgULSCompactLanguageLinksBetaFeature === false ) {
|
||||
$preferences['compact-language-links'] = [
|
||||
'type' => 'check',
|
||||
'section' => 'rendering/languages',
|
||||
'label-message' => 'ext-uls-compact-language-links-preference'
|
||||
];
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user