LangSwitch
Description
Adds a My Tools link to quickly switch languages
Updated
February 12, 2025
English (en) العربية (ar) беларуская (be) català (ca) Deutsch (de) Ελληνικά (el) emiliàn e rumagnòl (eml) español (es) eesti (et) suomi (fi) français (fr) हिन्दी (hi) hrvatski (hr) Bahasa Indonesia (id) italiano (it) 日本語 (ja) ქართული (ka) 한국어 (ko) latviešu (lv) Napulitano (nap) Nederlands (nl) polski (pl) português do Brasil (pt-br) русский (ru) српски (ћирилица) (sr-ec) srpski (latinica) (sr-el) Türkçe (tr) українська (uk) 中文(简体) (zh-hans) 中文(繁體) (zh-hant) 中文(香港) (zh-hk) 中文(臺灣) (zh-tw) Translate! [
View ]
LangSwitch adds a link to the My Tools Menu, which, when clicked, opens a prompt to quickly switch languages. If the text inputted in the prompt starts with a
/ it will reload to a different subpage instead (
Foo to
Foo/bar and
Foo/bar to
Foo/foo).
Installation
Add this to MediaWiki:ImportJS :
dev:LangSwitch.js
importArticles:
Add this JavaScript on your wiki (or add the highlighted text to your existing import statement):
importArticles ({ type : 'script' , articles : [ 'u:dev:MediaWiki:LangSwitch.js' , ] });
Local:
Special:MyPage/common.js
Importing multiple scripts? This quick guide shows how to combine the imports. For personal use, note that personal JS must be enabled for your account. If the script requires configuration through MediaWiki:Common.js for sitewide use, don't forget to contact Fandom Staff to get it enabled on your wiki, if it isn't already enabled.
Customization
The default language in the prompt is qqx. To change this, add window.LangSwitchDefault = 'yourlanguage'; above the import.
See also
Changelog
Text above can be found
here (edit )