قالب:Lang/doc

The purpose of this template is to indicate that a span of text belongs to a particular language. It often makes no visible changes to the text but can prompt web browsers to use a more appropriate font or screen readers to use a particular kind of pronunciation and so on. See § Rationale for more information.

Syntax and usage

     {{lang|language tag|text}}

The language tag should consist of an ISO-639 language code (click here for list of most codes). The template also supports properly formatted IETF language tags using subtags that identify the language's script, region, and/or variant. The ISO 639 language code is a two- or three-letter abbreviation, in lowercase, of the language's name. French, for example, has the code fr:

  • She said: "{{lang|fr|Je suis française.}}" → She said: "Je suis française."

Because all languages represented by two-letter codes in ISO 639-1 can also be represented by their three-letter equivalents in ISO 639-2 and above, it is recommended to use the shortest language tag possible that sufficiently describes the target language.[1] So while French could be represented by ISO 639-2's fra code, use the ISO 639-1 code fr instead. Likewise, script, region, and variant information should be included only when they provide a necessary distinction. For an up-to-date list of available language, script, region, and variant codes, please refer to the IANA's language subtag registry.

By default, this template will place articles into the relevant subcategory of قالب:Category link. To suppress this – e.g. when using {{lang}} within a wikilink or the title parameter of a citation – add the parameter |cat=no.

Formatting

Automatic italics

{{lang}} automatically applies italic styling when the text in {{{2}}} is written entirely in the Latn script (the Latin alphabet and its extensions), either when that is the default encoding for the language or when it is triggered by a xx-Latn language code:

  • {{lang|fr|Je suis française.}}Je suis française.
  • ''{{lang|fr|Je suis française.}}''Je suis française. – external markup is ignored
  • {{lang|he-Latn|la'az}} ({{lang|he|לעז}})la'az (לעז)
  • ''{{lang|he-Latn|la'az}}'' (''{{lang|he|לעז}}'')la'az (לעז) – external markup is ignored around the he-Latn text, but will incorrectly italicize the Hebrew-character material.

When Latn script should not be italicized, there are multiple approaches: |italic=no – renders {{{2}}} in upright font; italic markup around the template is ignored; italic markup inside the template causes an error message:

  • {{lang|fr|Je suis française.|italic=no}}Je suis française.
  • ''{{lang|fr|Je suis française.|italic=no}}''Je suis française.
  • ''{{lang|fr|Je suis ''française''.|italic=no}}''[Je suis française.] Error: {{Lang}}: text has italic markup (help) – italic markup in conflict with |italic=no

|italic=unset – disables template-provided styling; {{{2}}} is styled according to external or internal wiki markup:

  • {{lang|fr|Je suis française.|italic=unset}}Je suis française.
  • ''{{lang|fr|Je suis française.|italic=unset}}''Je suis française.
  • {{lang|fr|''Je suis'' English.|italic=unset}}Je suis English.

{{noitalic}} can also be used:

  • {{lang|fr|Je suis {{noitalic|English}}.}}Je suis English.