Jump to content

Template:Dir

From translatewiki.net

ltr

The documentation of this template is included from its /doc subpage.
Usage:
Return the main writing direction of a specified language.
Syntax:
  • {{Dir | 1 = language-code | 2 = RTL value | 3 = LTR value }}
  • {{Dir | lang = language-code | rtl = RTL value | ltr = LTR value }}
Parameters:
  • lang= or 1=: standard language code from BCP 47 (the letter case of the code is not significant), e.g. "en" for English, "ar" for Arabic, "he" for Hebrew.
  • rtl= or 2=: value to return if the language is written right-to-left,such as Arabic or Hebrew (optional, "rtl" by default)
  • ltr= or 3=: value to return if the language is written left-to-right, such as English or Chinese (optional, "ltr" by default)
Example:
  • "{{Dir}}" generates: "ltr"
  • "{{Dir|en}}" generates: "ltr"
  • "{{Dir|ar}}" generates: "rtl"
  • "{{Dir|en|right-to-left|left-to-right}}" generates: "left-to-right"
  • "{{Dir|ar|right-to-left|left-to-right}}" generates: "right-to-left"
See also: