From Wikisource
Jump to: navigation, search

This template tags pieces of text with the appropriate language code and allows for the implementation of Web Fonts.


 | language  = 
 | text      = 
 | direction = 
 | font      = 
 | style     =


  • language: (Also lang or the first unnamed parameter) The code for the language being displayed, using ISO 639
  • text: (Also the second unnamed parameter) The text to be displayed.
  • direction: (Also dir) Text direction, can be ltr (left-to-right) or rtl (right-to-left). Left-to-right is standard; right-to-left is used for languages such as Arabic and Hebrew. If this is not set, the template will attempt to select the correct text direction based on the language parameter.
  • font: Uses the webfont extension. See Web Fonts below.
  • style: The code for other optional CSS style being applied, such as font-feature-setting: 'locl'; for localized glyph(s).
  • attr: The code for other optional attributes being applied, such as class="plainlinks".


Hebrew text and unnamed parameters[edit]

{{lang|he|ארץ זבת חלב ודבש}}

ארץ זבת חלב ודבש

Th same text without this template: ארץ זבת חלב ודבש

Arabic text and named parameters[edit]

 | language = ar
 | text     = المدينة‎
 | dir      = rtl


Arabic text and non-standard web font[edit]



Burmese text and different web fonts[edit]







English text (Latin script) with web font[edit]

{{lang|text=Lorem ipsum|font=Rufscript}}

Lorem ipsum

{{lang|text=Lorem ipsum|font=Ubuntu}}

Lorem ipsum

{{lang|text=Lorem ipsum|font=UnifrakturMaguntia}}

Lorem ipsum

{{lang|en|Lorem ipsum|font=Linux Libertine}}

Lorem ipsum

Language attribute[edit]

As stated under parameters, the language should be set with an ISO 639 language code.

However, if necessary, this can be specified even further with an ISO 15924 script code and/or an ISO 3166-1 country code. Script codes can be used if the text is in a script other than that associated with the language. Country codes can be used to specify the text's country of origin.

Use Text Attribute Code Notes
Language Χαίρε, ω χαίρε Ελευθεριά! el {{lang|el|Χαίρε, ω χαίρε Ελευθεριά!}} Greek text. "el" = Greek language.
Script Haire, o haire, Eleftheria! el-Latn {{lang|el-Latn|Haire, o haire, Eleftheria!}} Transliterated into Latin script. "Latn" = Latin script.
Country Χαίρε, ω χαίρε Ελευθεριά! el-GR {{lang|el-GR|Χαίρε, ω χαίρε Ελευθεριά!}} Greek origin. "GR" = Greece.
Script & Country Haire, o haire, Eleftheria! el-Latn-GR {{lang|el-Latn-GR|Haire, o haire, Eleftheria!}} Greek language in Latin script from Greece.
See IETF language tag on Wikipedia for more information.

Web Fonts[edit]

This template makes use of the Universal Language Selector extension installed on this project. This extension allows for the proper display of languages where the standard font is either unavailable or of insufficient quality.

The language parameter will determine which font is used. In some cases, multiple fonts are available; the preferred font can be selected with the font parameter. If the font parameter is not used, the default font for that language will be selected. Currently no support for mobile devices.

Language ISO-639 Fonts
Ahirani ahr Lohit Devanagari
Akkadian akk Akkadian
Amharic am Abyssinica SIL
Arabic (Naskh script) ar Amiri
Nastaʿlīq script (Aran) Hussaini Nastaleeq
Assamese as Lohit Assamese
Bengali bn Lohit Bengali, Siyam Rupali
Bhojpuri bh Lohit Devanagari
Bishnupriya Manipuri bpy Lohit Bengali
Buginese bug Saweri
Burmese my Masterpiece Uni Sans
Dzongkha dz Jomolhari
Gujarati gu Lohit Gujarati
Hebrew he Alef
Miriam CLM
Taamey Frank CLM
Biblical Hebrew hbo Taamey Frank CLM
Hindi hi Lohit Devanagari
Samyak Devanagari
Kannada kn Lohit Kannada
Khmer km KhmerOSbattambang, KhmerOSsiemreap, KhmerOS, KhmerOSbokor, KhmerOSmuollight, KhmerOSmuol, KhmerOSmuolpali, KhmerOSfreehand
Konkani kok Lohit Devanagari
Latin script (Latn)   Charis SIL
Doulos SIL
Gentium Plus
Linux Libertine
Latin fraktur script (Latf)   UnifrakturMaguntia
Makassarese mak Saweri
Malayalam ml AnjaliOldLipi
Maithili mai Lohit Devanagari
Marathi mr Lohit Devanagari
Samyak Devanagari
Min Dong Chinese cdo Charis SIL
Doulos SIL
Oriya (Odia) or Lohit Oriya
Punjabi pa Lohit Punjabi
Persian (Farsi) fa IranianSans
Sourashtra saz Pagul
Sanskrit sa Lohit Devanagari, Samyak Devanagari
Tamil ta Lohit Tamil
Telugu te Lohit Telugu
Tibetan bo Jomolhari
Tigrinya ti Abyssinica SIL
Yi yi Nuosu SIL
See here for a list of all available fonts.

Language tagging[edit]

Texts on Wikisource should be tagged to specify the language in a machine readable format. All pages on English Wikisource are are automatically tagged as "English". Any piece of text that is not in English should be tagged as such with this template or one of its derivatives.

Language tagging on Meta-Wiki explains the best practice of language tagging.

See also[edit]