Topic on Extension talk:UniversalLanguageSelector

Modifying Default Settings

12
Wikimanz (talkcontribs)

Previously I have been using Narayam extension with great success and customization to fit my local wiki. Updating to this extension I was hoping to set it up to fit my wiki but I seem to be confused as to how to edit the default settings. Some of the following are things I want to do

1) I want to set up the default input language to be loaded regardless of country or interface language

2) similarily I want to set up the default interface language. However, is there anyway not to force changing the font a person already has when doing this. After this, everytime I refresh the page, it gdisplays the original font and then quickly reverts back to the font as set in webfont.

In addition is it possible to change both interface and input with a single drop down menu. For mixed content wiki, sometimes english is better for interface while allowing local language input.

3) How to remove some country/language options from the drop down as my wiki caters to a niche population. I only want english and my local language to be displayed as choices for interfase and input

4) previously using control+M on keyboard combination enabled the input for my local language from english while changing the background where inputs are written to a light blue color to differentiate the input method has changed. Possibility of the color to come back as the color change is a great and simple way for users to tell when they are quickly switching between the input methods using Ctr+M keyboard.

6) How to disable the webfont function in ULS.

5) The transliteration drop down menu is small and often if the mouse button is still hovering in the search bar, the default popup mentioning the search bar covers the transliteration drop down making it hard to select unless mouse is moved away. A better and easily accessible location should be though of.

I previously worked with the developer of Narayam (Junaid) with these features by suggesting ideas and by requesting for the amharic language better and making the input better. If you can briefly describe me the process to do the above things I would greatly appreciate it. Thank you for the great work.

Thanks

Siebrand (talkcontribs)

1) I want to set up the default input language to be loaded regardless of country or interface language

This is not possible with ULS. The default language for an input method will be the wiki's content language. Initially, input methods are enabled, and no keyboard mappings are active. A user will have to enable a keymapping.

Siebrand (talkcontribs)

2) similarily I want to set up the default interface language. However, is there anyway not to force changing the font a person already has when doing this. After this, everytime I refresh the page, it gdisplays the original font and then quickly reverts back to the font as set in webfont.

MediaWiki provides the wiki's content language by default. There is no feature to have it different from the content language. ULS allows to set the UI language to the language identified through the Accept-Language of the browser of the user. Related settings in LocalSettings.php are $wgULSLanguageDetection, $wgULSAnonCanChangeLanguage and $wgULSEnableAnon.

See Extension:Universal_Language_Selector#Configuration for more details.

Siebrand (talkcontribs)

3) How to remove some country/language options from the drop down as my wiki caters to a niche population. I only want english and my local language to be displayed as choices for interfase and input

ULS has no such feature at the moment. We are open to receiving patches.

Larrydberg (talkcontribs)

I would like to add my voice to this request. For two-language wikis, the dropdown is far more featureful and inclusive than necessary. Perhaps there could be an array of languages offered. Indeed, I don't even really want the flyout---I just want to offer a link that says "Switch language" that toggles from one language to the other, or perhaps a pair of flags that you can click on to set the language. (This is common on bilingual pages.)

LaKing (talkcontribs)

Edit the file UniversalLangauageSelector.hooks.php

Find the function addVariables. (Line 248)

	public static function addVariables( &$vars, OutputPage $out ) {
		// This is the original code
		//$vars['wgULSLanguages'] = Language::fetchLanguageNames(
		//	$out->getLanguage()->getCode(), 'mwfile'
		//);
		// The following line is a limitation, to two languages.
		$vars['wgULSLanguages'] = array('en'=>'en', 'hu'=>'hu');
		
		$vars['wgULSAcceptLanguageList'] = array_keys( $out->getRequest()->getAcceptLang() );

		return true;
	}

It is not perfect, and a bit hackish, but should do the job.

Devaroo (talkcontribs)

If anyone is wondering in 2023, this is currently in ResourceLoaderULSModule.php (line 44-48).


@LaKing thanks for this solution, still super helpful :-)

Siebrand (talkcontribs)

4) previously using control+M on keyboard combination enabled the input for my local language from English while changing the background where inputs are written to a light blue color to differentiate the input method has changed. Possibility of the color to come back as the color change is a great and simple way for users to tell when they are quickly switching between the input methods using Ctr+M keyboard.

Thank you for the suggestion. We decided to drop background coloring to reduce interface clutter and make things more consistent. There are no plans to bring that feature back.

Siebrand (talkcontribs)

6) How to disable the webfont function in ULS.

Disabling web fonts in ULS is not possible. Users can disable web fonts on a per language basis, and it is possible to do some customisation.

Nemo bis (talkcontribs)

"Sometimes there are multiple fonts for a language and there is a default font for each language/script": it would be useful to have a readable table of what's default for what, so that users know to expect when they install ULS on their wiki. Is the big one-line json file the only place currently, or is there something else to work on?

Siebrand (talkcontribs)

5) The transliteration drop down menu is small and often if the mouse button is still hovering in the search bar, the default popup mentioning the search bar covers the transliteration drop down making it hard to select unless mouse is moved away. A better and easily accessible location should be though of.

We have considered many options. We are open to a better option that the one currently implemented. See bugzilla:50787, comment 4 for a detailed list of considerations by one of our user interaction designers.

Siebrand (talkcontribs)

As you can see I have chosen to reply to your 6 items in 6 different sub-threads. I think that makes the discussion easier to follow. I would like to request that you start separate threads in the future, or use Bugzilla, our issue tracker, to report feature requests and change requests.

I previously worked with the developer of Narayam (Junaid) with these features by suggesting ideas and by requesting for the amharic language better and making the input better. If you can briefly describe me the process to do the above things I would greatly appreciate it. Thank you for the great work.

We haven't heard from Junaid for a long time; aside from the input methods that have been taken over from Narayam, I don't think Junaid has contributed to ULS yet. We'd love to work with him again.

I've tried to reply to each of your requests. Some I would not consider as features that would be supported in ULS, others could be supported, but will not be prioritized by Wikimedia Language Engineering anytime soon. As said, we do accept patches, and we are open to discuss options with volunteer developers. We will also review code submissions for Project Milkshake components, as well as Extension:UniversalLanguageSelector.

Thanks for all your feedback.

Reply to "Modifying Default Settings"