Template:Dir

From OpenStreetMap Wiki
Jump to navigation Jump to search

ltr

[Edit] [Purge] Template-info.svg Template documentation

Usage

  • {{Dir|lang= language-code |ltr= text if left-to-right |rtl= text if right-to-left }}
  • {{Dir|lang= language-code |1= text if left-to-right |2= text if right-to-left }}
  • {{Dir|lang= language-code |text if left-to-right|text if right-to-left}}
  • {{Dir|lang= language-code }}
  • {{Dir|ltr= text if left-to-right |rtl= text if right-to-left }}
  • {{Dir|1= text if left-to-right |2= text if right-to-left }}
  • {{Dir|text if left-to-right|text if right-to-left}}
  • {{Dir}}

Parameters

|lang = language-code
(optional) the language for which to determine the writing direction (by default the language is determined from the current page using {{Langcode}})
If the language-code is set explicitly to an empty string, the default language is still determined by {{Langcode}}.
|1 = text if left-to-right (not recommended) or
|ltr = text if left-to-right (preferred)
(optional) the text to return if the language is left-to-right (by default return ltr)
|2 = text if right-to-left (not recommended) or
|rtl = text if right-to-left (preferred)
(optional) the text to return if the language is right-to-left (by default return rtl)
Note that the default values ltr or rtl for text if left-to-right and text if right-to-left are returned only if you do not explicitly set parameters 1, 2, ltr, or rtl; you can set the parameter explicitly to an empty string.
So, {{Dir||}}, {{Dir|1= |2= }}, or {{Dir|ltr= |rtl= }} will always return an empty string because both parameters are set to an empty string.

Note

The following languages codes are currently recognized by this template as being written right-to-left :

aeb ar arc arq arz azb bcc bgn bqi ckb dv fa fa-af glk ha-arab he khw kk-arab kk-cn ks ks-arab ku-arab lrc mzn pnb prd ps sd ug ug-arab ur uz-arab ydd yi

These are languages normally written by supported right-to-left scripts such as (see the ISO 15924 standard for script codes):

Arab Aran Armi Avst Aran Hatr Hebr Lydi Mand Mani Merc Mero Narb Nkoo Palm Phli Phlp Phlv Phnx Prti Rohg Samr Sarb Sogd Sogo Syrc Syrn Syrj Syre Tfng Thaa

However, modern languages using right-to-left scripts are limited to just a few scripts:

Arab Aran Hebr Nkoo Syrc Syrn Syrj Syre Tfng Thaa (Arabic variants, Hebrew, N’ko, Syriac variants, Tifinagh, and Thaana)

So all other languages whose code is not in the first list are assumed to be written left-to-right.

See also