Jump to content

Module:Language/doc

E tswa ho Wikipedia

This is the documentation page for Module:Language

Template:Language templates Template:Lua

This module is used by Template:Tlx and Template:Tlx. 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

[fetola mohloli]
* {{#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|wikt|ar|العَرَبِيَّة}}
* {{#invoke:Language|wikt|fa|فارسی}}
* {{#invoke:Language|wikt|ine-x-proto|*h₂enǵʰ-}}
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.

Invalid codes

[fetola mohloli]
* {{#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|wikt|Ar|العَرَبِيَّة}}
* {{#invoke:Language|wikt|Fa|فارسی}}
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.
* {{#invoke:Language|wikt|en-Latin|language}}
  • Lua error in package.lua at line 80: module 'Module:Unicode data' not found.

Tracking categories

[fetola mohloli]