Template:Dir/doc
Appearance
This is the documentation subpage for the parent Template:Dir page.
- 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=
or1=
: 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=
or2=
: value to return if the language is written right-to-left,such as Arabic or Hebrew (optional, "rtl" by default)ltr=
or3=
: 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: