Template:Lang/doc: Difference between revisions
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
<code><nowiki>She said: "{{lang|fr|Je suis française.}}"</nowiki></code> → She said: "{{lang|fr|Je suis française.}}" | <code><nowiki>She said: "{{lang|fr|Je suis française.}}"</nowiki></code> → She said: "{{lang|fr|Je suis française.}}" | ||
Because all languages represented by two-letter codes in [[w:ISO 639-1|ISO 639-1]] can also be represented by their three-letter equivalents in [[w:ISO 639-2|ISO 639-2]] and above, it is recommended to use the shortest language tag possible that sufficiently describes the target language.<ref>[https://www.w3.org/International/articles/language-tags/index.en "Language tags in HTML and XML"] at [[w:World Wide Web Consortium|]]</ref> So while French could be represented by 639‑2's <code>fra</code> code, use the 639‑1 code <code>fr</code> 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 [[w:Internet Assigned Numbers Authority|IANA]]'s [http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry language subtag registry]. | Because all languages represented by two-letter codes in [[w:ISO 639-1|ISO 639-1]] can also be represented by their three-letter equivalents in [[w:ISO 639-2|ISO 639-2]] and above, it is recommended to use the shortest language tag possible that sufficiently describes the target language.<ref>[https://www.w3.org/International/articles/language-tags/index.en "Language tags in HTML and XML"] at [[w:World Wide Web Consortium|World Wide Web Consortium]]</ref> So while French could be represented by 639‑2's <code>fra</code> code, use the 639‑1 code <code>fr</code> 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 [[w:Internet Assigned Numbers Authority|IANA]]'s [http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry language subtag registry]. | ||
== References == | == References == | ||
<references /> | <references /> |
Latest revision as of 14:38, 19 February 2021
This template is integrated many times. If you know exactly what the effects are, you can edit it. In most cases, however, it makes sense to first vote on change requests on Template Discussion. |
Syntax and usage
{{lang|language tag|text}}
The language tag should consist of an ISO 639 language code. The template 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 639‑2's fra
code, use the 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.