Template:LangDirSwitch: Difference between revisions

From Test Wiki
Jump to navigation Jump to search
m Protected "Template:LangDirSwitch": Widely used template ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))
 
m 1 revision imported
 
(No difference)

Latest revision as of 05:25, 22 February 2026


Template documentation

Use this template to check whether the current user's language is a right-to-left or a left-to-right language. The following code shows how the template works: {{LangDirSwitch|rtl=text for right-to-left languages|ltr=text for left-to-right languages}}. The result is: text for left-to-right languages. (Logged-in users can test this out by setting their display language to a right-to-left language, such as Arabic or Hebrew; the green text should now read "text for right-to-left languages".)

This template can also be applied when dealing with page elements with a fixed position. For instance, users reading in left-to-right languages see Top icons on the upper-right-hand side of their page, while users reading in right-to-left ones see them on the upper-left-hand side. (Try it: English; Hebrew.)

If you read Wikidata in a right-to-left language, and find that this template (or templates that use it) are not working for you, please file a request at the Administrators' noticeboard requesting that a sysop create an interface page for your language: It should be entitled MediaWiki:Rtl/<Wikipedia code for your language>, and its text should be nothing but the Wikipedia code for your language. For instance, the page for Hebrew-speakers is MediaWiki:Rtl/he, and its text reads he. If you don't know the Wikipedia code for your language, please see m:List of Wikipedias. If it takes a long time for the page to get created, and it's really bothering you, you can create a temporary workaround in the template yourself, but only if you're familiar enough with template syntax that you're confident you won't break anything.