Thread:Talk:Universal Language Selector/How can I provide a more focussed way of changing the interface language?/reply

OK, I managed this one myself, and I'll record the solution here in case it helps anyone else. The goal is to provide links that switch interface language without changing the current page. I put these links at the top of the sidebar; you can see them at http://horawiki.org/ (a link "עברית" that switches to Hebrew) and http://horawiki.org.il/ (a link "English" that switches to English).

1) On MediaWiki:sidebar, add line "switchlanguage|otherlanguage"

2) MediaWiki:otherlanguage contains the word "עברית", MediaWiki:otherlanguage/he contains the word "English"

3) MediaWiki:switchlanguage contains " ", and MediaWiki:switchlanguage/he is the same except with setlang=en

4) To make the system access language-dependent versions of MediaWiki:switchlanguage, put "$wgForceUIMsgAsContentMsg = array('switchlanguage');" into LocalSettings.php

This seems to do it. Improvements or suggestions gratefully accepted.

The initial language choices in the Languages tool can be manipulated with a tiny modification to routine getFrequentLanguageList in UniversalLanguageSelector/resources/js/ext.uls.init.js, but this is a terrible idea since changes there are overwritten with the next release.