Template:Lang/doc

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

This template is a  template.

lang block is the  version of this template.

text

Parameters

 * : (Also  or the first unnamed parameter) The code for the language being displayed, using ISO 639. This can be two or three letters depending on the specificity of the language you are declaring. For example "French" is   is, but "Old French" is.
 * : (Also the second unnamed parameter) The text to be displayed.
 * : (Also ) Text direction, can be   (left-to-right) or   (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.
 * : Uses the webfont extension. See Web Fonts below.
 * : The code for other optional CSS style being applied, such as  for localized glyph(s).
 * : Any HTML classes to apply, such as.
 * : The code for other optional HTML attributes being applied

Internal parameters
This parameter is for internal use only, to distiguish between lang and lang block.

It shall not be used directly.
 * : The type of template:
 * will provide an inline template ( ...  ); this is used internally in  lang.
 * (or != yes) will provide a block template ( ...  ); this is used internally in lang block.

This parameter can be used by  templates to not close the tag, but instead leave it open, e.g. for crossing a page break.
 * : The type of template:
 * leave the tag open
 * Any other value: close the tag as normal

Hebrew text and unnamed parameters
ארץ זבת חלב ודבש ארץ זבת חלב ודבש

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

Arabic text and non-standard web font
المدينة‎ المدينة‎

Burmese text and different web fonts
အ​ကူ​အ​ညီ​ အ​ကူ​အ​ညီ​ အ​ကူ​အ​ညီ​ အ​ကူ​အ​ညီ​ အ​ကူ​အ​ညီ​ အ​ကူ​အ​ညီ​

English text (Latin script) with web font
Lorem ipsum Lorem ipsum

Language attribute
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.

Web Fonts
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  parameter will determine which font is used. In some cases, multiple fonts are available; the preferred font can be selected with the  parameter. If the  parameter is not used, the default font for that language will be selected. Currently no support for mobile devices.

Language tagging
Texts on Wikisource should be tagged to specify the language in a machine readable format. All pages on English Wikisource 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.

Blocks split across pages
For blocks in a different language split across multiple pages, use lang block/s to begin the block and lang block/e to end it. lang block/s takes the same parameters as except for inline, which is fixed as "no".