Provide a base ULS RL module and seperate UI language selection
ULS is disabled for anonymous users on WMF projects. But to provide rest of the features - apis, language database, language selection for many use cases, we need to provide a minimal ULS. RL module ext.uls.init does that job now. For using ULS as interface language selection tool, new RL module ext.uls.interface is introduced. That will add UI language selection, webfonts, ime features, if enabled. Change-Id: I796a7c9cce0de42bf8aa06b26e383e0075dbe1dd
This commit is contained in:
committed by
Gerrit Code Review
parent
d4cea039b4
commit
453912fdf2
@@ -39,12 +39,13 @@ class UniversalLanguageSelectorHooks {
|
||||
* @return bool
|
||||
*/
|
||||
public static function addModules( $out, $skin ) {
|
||||
if ( !self::isToolbarEnabled( $out->getUser() ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// If extension is enabled, basic features(API, language data) available.
|
||||
$out->addModules( 'ext.uls.init' );
|
||||
$out->addModules( 'ext.uls.geoclient' );
|
||||
if ( self::isToolbarEnabled( $out->getUser() ) ) {
|
||||
// Enable UI language selection for the user.
|
||||
$out->addModules( 'ext.uls.interface' );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -58,7 +59,7 @@ class UniversalLanguageSelectorHooks {
|
||||
public static function addTestModules( array &$testModules, ResourceLoader &$resourceLoader ) {
|
||||
$testModules['qunit']['ext.uls.tests'] = array(
|
||||
'scripts' => array( 'tests/qunit/ext.uls.tests.js' ),
|
||||
'dependencies' => array( 'ext.uls.init' ),
|
||||
'dependencies' => array( 'ext.uls.init', 'ext.uls.interface' ),
|
||||
'localBasePath' => __DIR__,
|
||||
'remoteExtPath' => 'UniversalLanguageSelector',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user