Merge "Introduce a preference to disable compact language links"
This commit is contained in:
@@ -75,7 +75,8 @@ class UniversalLanguageSelectorHooks {
|
|||||||
|
|
||||||
if ( $wgULSCompactLanguageLinksBetaFeature === false ) {
|
if ( $wgULSCompactLanguageLinksBetaFeature === false ) {
|
||||||
// Compact language links is a default feature in this wiki.
|
// Compact language links is a default feature in this wiki.
|
||||||
return true;
|
// Check user preference
|
||||||
|
return $user->getBoolOption( 'compact-language-links' );
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -340,6 +341,8 @@ class UniversalLanguageSelectorHooks {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static function onGetPreferences( $user, &$preferences ) {
|
public static function onGetPreferences( $user, &$preferences ) {
|
||||||
|
global $wgULSCompactLanguageLinksBetaFeature;
|
||||||
|
|
||||||
$preferences['uls-preferences'] = [
|
$preferences['uls-preferences'] = [
|
||||||
'type' => 'api',
|
'type' => 'api',
|
||||||
];
|
];
|
||||||
@@ -354,6 +357,14 @@ class UniversalLanguageSelectorHooks {
|
|||||||
// showing the link when javascript is disabled.
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,8 @@
|
|||||||
"UniversalLanguageSelectorHooks": "UniversalLanguageSelector.hooks.php"
|
"UniversalLanguageSelectorHooks": "UniversalLanguageSelector.hooks.php"
|
||||||
},
|
},
|
||||||
"DefaultUserOptions": {
|
"DefaultUserOptions": {
|
||||||
"uls-preferences": ""
|
"uls-preferences": "",
|
||||||
|
"compact-language-links": true
|
||||||
},
|
},
|
||||||
"config": {
|
"config": {
|
||||||
"@ULSGeoService": "ULS can use geolocation services to suggest languages based on the country the user is vising from. Setting this to false will prevent builtin geolocation from being used. You can provide your own geolocation by setting window.Geo to object which has key \"country_code\" or \"country\". If set to true, it will query Wikimedia's geoip service. The service should return jsonp that uses the supplied callback parameter.",
|
"@ULSGeoService": "ULS can use geolocation services to suggest languages based on the country the user is vising from. Setting this to false will prevent builtin geolocation from being used. You can provide your own geolocation by setting window.Geo to object which has key \"country_code\" or \"country\". If set to true, it will query Wikimedia's geoip service. The service should return jsonp that uses the supplied callback parameter.",
|
||||||
|
|||||||
@@ -70,5 +70,7 @@
|
|||||||
"apihelp-ulslocalization-description": "Get the localization of ULS in the given language.",
|
"apihelp-ulslocalization-description": "Get the localization of ULS in the given language.",
|
||||||
"apihelp-ulslocalization-param-language": "Language code.",
|
"apihelp-ulslocalization-param-language": "Language code.",
|
||||||
"apihelp-ulslocalization-example-1": "Get Tamil localization",
|
"apihelp-ulslocalization-example-1": "Get Tamil localization",
|
||||||
"apihelp-ulslocalization-example-2": "Get Hindi localization"
|
"apihelp-ulslocalization-example-2": "Get Hindi localization",
|
||||||
|
"prefs-languages": "Languages",
|
||||||
|
"ext-uls-compact-language-links-preference": "Use a compact language list, with languages relevant to you."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,5 +72,7 @@
|
|||||||
"apihelp-ulslocalization-description": "{{doc-apihelp-description|ulslocalization}}",
|
"apihelp-ulslocalization-description": "{{doc-apihelp-description|ulslocalization}}",
|
||||||
"apihelp-ulslocalization-param-language": "{{doc-apihelp-param|ulslocalization|language}}\n{{Identical|Language code}}",
|
"apihelp-ulslocalization-param-language": "{{doc-apihelp-param|ulslocalization|language}}\n{{Identical|Language code}}",
|
||||||
"apihelp-ulslocalization-example-1": "{{doc-apihelp-example|ulslocalization}}",
|
"apihelp-ulslocalization-example-1": "{{doc-apihelp-example|ulslocalization}}",
|
||||||
"apihelp-ulslocalization-example-2": "{{doc-apihelp-example|ulslocalization}}"
|
"apihelp-ulslocalization-example-2": "{{doc-apihelp-example|ulslocalization}}",
|
||||||
|
"prefs-languages": "Field set legend for user preferences regarding display of language lists",
|
||||||
|
"ext-uls-compact-language-links-preference": "Label for compact language links user preference"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user