Difference between revisions of "Module:Language/doc"
blackwiki>BrandonXLF (→Errors) |
blackwiki>Erutuon (note on data module) |
||
| Line 3: | Line 3: | ||
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | ||
| − | |||
This module is used by {{tlx|wikt-lang}} and {{tlx|wt}}. It is inspired by the templates [[wikt:Template:m|{{((}}m{{))}}]] and [[wikt:Template:l|{{((}}l{{))}}]] and their associated modules on Wiktionary. It has a Wiktionary link function that links to the correct section of the Wiktionary entry, and applies correct language formatting and italics. The language-tagging function does most of what {{t|lang}} does, except that italics can't be customized and categories aren't added. | This module is used by {{tlx|wikt-lang}} and {{tlx|wt}}. It is inspired by the templates [[wikt:Template:m|{{((}}m{{))}}]] and [[wikt:Template:l|{{((}}l{{))}}]] and their associated modules on Wiktionary. It has a Wiktionary link function that links to the correct section of the Wiktionary entry, and applies correct language formatting and italics. The language-tagging function does most of what {{t|lang}} does, except that italics can't be customized and categories aren't added. | ||
| + | |||
| + | The module uses [[Module:Language/data]] to retrieve the language name for a language code, and to perform the necessary entry-name replacements (for instance, removing macrons from Latin entry names). These are unfortunately not automatically retrieved from Wiktionary's [[wikt:Category:Language data modules|language data modules]]. For language codes that do not have a <code>name</code> value in this module, the language name is fetched with <code>mw.language.fetchLanguage</code>. When <code>mw.language.fetchLanguage</code> does not fetch the correct language name (or any language name at all), please add it to [[Module:language/data]], and similarly when the correct entry name is not generated, please add the entry name replacements to the module. | ||
===Examples=== | ===Examples=== | ||
Revision as of 20:46, 26 December 2019
| This module is rated as beta, and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected. |
| Language templates |
|---|
| Languages (ISO 639) |
|
| Wiktionary links |
|
| Other |
|
| Data |
This module is used by {{wikt-lang}} and {{wt}}. It is inspired by the templates {{m}} and {{l}} and their associated modules on Wiktionary. It has a Wiktionary link function that links to the correct section of the Wiktionary entry, and applies correct language formatting and italics. The language-tagging function does most of what Template:T does, except that italics can't be customized and categories aren't added.
The module uses Module:Language/data to retrieve the language name for a language code, and to perform the necessary entry-name replacements (for instance, removing macrons from Latin entry names). These are unfortunately not automatically retrieved from Wiktionary's language data modules. For language codes that do not have a name value in this module, the language name is fetched with mw.language.fetchLanguage. When mw.language.fetchLanguage does not fetch the correct language name (or any language name at all), please add it to Module:language/data, and similarly when the correct entry name is not generated, please add the entry name replacements to the module.
Examples
* {{#invoke:language|wikt|en|language}}
* {{#invoke:language|wikt|en|language|languages}}
* {{#invoke:Language|wikt|fr|bourguignon}}
* {{#invoke:Language|wikt|la|homō}}
* {{#invoke:Language|wikt|grc|δημοκρατίᾱ}}
* {{#invoke:Language|wikt|ru|язы́к}}
* {{#invoke:Language|lang|ru|язы́к}}
* {{#invoke:Language|wikt|ar|العَرَبِيَّة}}
* {{#invoke:Language|wikt|fa|فارسی}}
* {{#invoke:Language|wikt|ine-x-proto|*h₂enǵʰ-}}
Invalid codes
* {{#invoke:language|wikt|EN|language}}
* {{#invoke:language|wikt|En|language|languages}}
* {{#invoke:Language|wikt|La|homō}}
* {{#invoke:Language|wikt|Grc|δημοκρατίᾱ}}
* {{#invoke:Language|wikt|Ru|язы́к}}
* {{#invoke:Language|lang|Ru|язы́к}}
* {{#invoke:Language|wikt|Ar|العَرَبِيَّة}}
* {{#invoke:Language|wikt|Fa|فارسی}}
Errors
* {{#invoke:Language|wikt|en-Latin|language}}
- language [
Latinis not a valid script code.]
Subpages
Pages with the prefix 'Language' in the 'Script error: No such module "If empty".' and 'Module talk' namespaces:
| Language |
- Language/data
- Language/data/ISO 639-1
- Language/data/ISO 639-1/doc
- Language/data/ISO 639-1/make
- Language/data/ISO 639-1/make/doc
- Language/data/ISO 639-2
- Language/data/ISO 639-2/doc
- Language/data/ISO 639-2/make
- Language/data/ISO 639-2/make/doc
- Language/data/ISO 639-2B
- Language/data/ISO 639-2B/doc
- Language/data/ISO 639-3
- Language/data/ISO 639-3/doc
- Language/data/ISO 639-3/make
- Language/data/ISO 639-3/make/doc
- Language/data/ISO 639-3 (dep)
- Language/data/ISO 639-3 (dep)/doc
- Language/data/ISO 639-3 (dep)/make
- Language/data/ISO 639-5
- Language/data/ISO 639-5/doc
- Language/data/ISO 639-5/make
- Language/data/ISO 639-5/make/doc
- Language/data/ISO 639 deprecated
- Language/data/ISO 639 deprecated/doc
- Language/data/ISO 639 name to code
- Language/data/ISO 639 name to code/doc
- Language/data/ISO 639 name to code/make
- Language/data/ISO 639 name to code/make/doc
- Language/data/ISO 639 name to code/sandbox
- Language/data/ISO 639 override
- Language/data/ISO 639 override/doc
- Language/data/doc
- Language/data/iana languages
- Language/data/iana languages/doc
- Language/data/iana languages/make
- Language/data/iana languages/make/doc
- Language/data/iana regions
- Language/data/iana scripts
- Language/data/iana suppressed scripts
- Language/data/iana variants
- Language/data/iso 15924
- Language/data/iso 15924/doc
- Language/data/wp languages
- Language/data/wp languages/doc
- Language/doc
- Language/name/data
- Language/name/data/doc
- Language/sandbox
- Language/scripts
- Language/scripts/codepoints
- Language/scripts/codepoints/doc
- Language/scripts/codepoints/make
- Language/scripts/codepoints/make/doc
- Language/scripts/data
- Language/scripts/data/doc
- Language/scripts/doc
- Language/scripts/testcases
- Language/testcases