Module: Language/doc
enwiki>Gonnym (cleanup and place examples near their code) |
m (1 revision imported) |
(No difference)
|
Latest revision as of 18:57, 28 February 2024
Language templates |
---|
Language names (ISO 639) |
|
Interwiki links |
Foreign-language text |
|
Other |
This module depends on the following other modules: |
This module is used by {{wikt-lang}}
. 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 {{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 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}}
-> language{{#invoke:Language|wikt|en|language|languages}}
-> languages{{#invoke:Language|wikt|fr|bourguignon}}
-> bourguignon{{#invoke:Language|wikt|la|homō}}
-> homō{{#invoke:Language|wikt|grc|δημοκρατίᾱ}}
-> δημοκρατίᾱ{{#invoke:Language|wikt|ru|язы́к}}
-> язы́к{{#invoke:Language|wikt|ar|العَرَبِيَّة}}
-> العَرَبِيَّة{{#invoke:Language|wikt|fa|فارسی}}
-> فارسی{{#invoke:Language|wikt|ine-x-proto|*h₂enǵʰ-}}
-> *h₂enǵʰ-
Invalid codes
{{#invoke:Language|wikt|EN|language}}
-> language{{#invoke:Language|wikt|En|language|languages}}
-> languages{{#invoke:Language|wikt|La|homō}}
-> homō{{#invoke:Language|wikt|Grc|δημοκρατίᾱ}}
-> δημοκρατίᾱ{{#invoke:Language|wikt|Ru|язы́к}}
-> язы́к{{#invoke:Language|wikt|Ar|العَرَبِيَّة}}
-> العَرَبِيَّة{{#invoke:Language|wikt|Fa|فارسی}}
-> فارسی
Errors
{{#invoke:Language|wikt|en-Latin|language}}
-> language [Latin
is not a valid script code.]
Tracking categories
- Category:Language module errors (0)
- Category:Language module reconstructed with no asterisk (0)
- Category:Language module using redirect code (0)