Template:Dir/doc: Difference between revisions
Jump to navigation
Jump to search
m 1 revision imported |
mNo edit summary |
||
Line 1: | Line 1: | ||
<noinclude>{{Documentation subpage}}<noinclude> | |||
{{Documentation subpage}} | |||
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> | <!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --> | ||
; Usage | ; Usage | ||
: Outputs "<code>rtl</code>" for right-to-left languages else "<code>ltr</code>". | : Outputs "<code>rtl</code>" for right-to-left languages else "<code>ltr</code>". |
Revision as of 11:55, 24 November 2021
This is a documentation subpage for Template:Dir. It contains usage information, categories and other content that is not part of the original Template page. |
- Usage
- Outputs "
rtl
" for right-to-left languages else "ltr
". - The default returned values "
rtl
" and "ltr
" can also be customized.
- Syntax
-
-
- The 1st (optional) parameter language-code (whose value may be passed alternatively by name as
|lang=
) should be conforming to BCP47, as required by web standards (HTML/CSS...), rather than Wikimedia labels for designating languages in domain names (in some cases, Wikimedia language codes are not conforming and only used for interwikis and URLs; most of them are being migrated to BCP47, which is based on some parts of the ISO649 standard). - If no language-code parameter is specified, it defaults to the preferred UI language of the visitor viewing the current page, which for you is currently
⧼Lang⧽
.
- The 1st (optional) parameter language-code (whose value may be passed alternatively by name as
-
- The 2nd and 3rd (optional) parameters allow changing the default return values for languages written in RTL and LTR scripts (respectively), whose default are "
rtl
" and "ltr
". These return values may be passed alternatively by name as|rtl=
andltr=
. - This can be used to customize CSS styles such as text alignment or floatting side or lateral margins/borders/paddings, or to change the displayed text/symbols or names of images/icons depending on the script direction.
- The 2nd and 3rd (optional) parameters allow changing the default return values for languages written in RTL and LTR scripts (respectively), whose default are "
-
- Note
- Currently it recognizes the following codes of languages usually written in a right-to-left script.
- All other languages will be assumed to use a left-to-right script.
Code | Language |
---|---|
aeb | تونسي / Tûnsî |
aeb-arab | تونسي |
aic | aic |
ar | العربية |
arc | ܐܪܡܝܐ |
arq | جازايرية |
ary | الدارجة |
arz | مصرى |
azb | تۆرکجه |
bcc | جهلسری بلوچی |
bgn | روچ کپتین بلوچی |
bqi | بختیاری |
bqp | bqp |
ckb | کوردی |
ckb-arab | ckb-Arab |
dv | ދިވެހިބަސް |
en-rtl | en-x-rtl |
fa | فارسی |
fa-af | fa-AF |
glk | گیلکی |
ha-arab | ha-Arab |
haz | haz |
he | עברית |
khw | کھوار |
kk-arab | قازاقشا (تٴوتە) |
kk-cn | قازاقشا (جۇنگو) |
ks | कॉशुर / کٲشُر |
ks-arab | کٲشُر |
ku-arab | کوردی (عەرەبی) |
lki | لەکی |
lrc | لۊری شومالی |
luz | لئری دوٙمینی |
mzn | مازِرونی |
nqo | ߒߞߏ |
ota | ota |
phn | phn |
pnb | پنجابی |
prd | prd |
prs | prs |
ps | پښتو |
sd | سنڌي |
sdh | کوردی خوارگ |
skr | سرائیکی |
skr-arab | سرائیکی |
tg-arab | tg-Arab |
tly | tolışi |
ug | ئۇيغۇرچە / Uyghurche |
ug-arab | ئۇيغۇرچە |
ur | اردو |
uz-arab | uz-Arab |
xpu | xpu |
ydd | ydd |
yi | ייִדיש |
- Examples
-
- , for the current user language which is ⧼lang⧽ (⧼lang⧽), returns
ltr
. - , for English (English), returns
ltr
. - , for English (English), returns
ltr
. - , for العربية (العربية), returns
rtl
. - , for ייִדיש (ייִדיש), returns
rtl
. - , for the current user language which is ⧼lang⧽ (⧼lang⧽), returns
left
. - , for the current user language which is ⧼lang⧽ (⧼lang⧽), returns
left
. - , for English (English), returns
left
. - , for العربية (العربية), returns
right
. - , for ייִדיש (ייִדיש), returns
right
. - , for ייִדיש (ייִדיש), returns
right
.
- , for the current user language which is ⧼lang⧽ (⧼lang⧽), returns
TemplateData
Outputs “rtl” for right-to-left languages, else “ltr”. The default returned values “rtl” and “ltr” can also be customized.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Language | 1 | The language to get the direction for, by default the interface language
| Line | required |
Right-to-Left | 2 | Return value for right-to-left languages
| String | optional |
Left-to-Right | 3 | Return value for left-to-right languages
| String | optional |
Edit parameter translations