Template:Translit module documentation

From The Languages of David J. Peterson
Revision as of 01:49, 8 November 2019 by Djp (talk | contribs) (Created page with "This module will transliterate <!-- XXX: needs a way to generate category names reliably -->{{#if:{{#invoke:languages/templates|exists|{{{1|und}}}}}<!-- -->|<!-- -->:Cate...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This module will transliterate Undetermined language text. Lua error in package.lua at line 80: module 'Module:translit-redirect/data' not found.

The module should preferably not be called directly from templates or other modules. To use it from a template, use {{xlit}}. Within a module, use Module:languages#Language:transliterate.

For testcases, see Module:Translit module documentation/testcases.

Functions

tr(text, lang, sc)
Transliterates a given piece of text written in the script specified by the code sc, and language specified by the code lang. When the transliteration fails, returns nil.

This template generates documentation pages for transliteration modules. It requires a single parameter: the language or script code. The second parameter provides optional text to be displayed after "This module will transliterate x language text".

If the second parameter is not provided, the languages that use the module will be listed, if they can be detected. In all cases, a category will be added for every language, and the category Transliteration modules will be added, with the canonical name corresponding to the code in the module name as sortkey (for example, Module:sa-translit[[Category:Transliteration modules|Sanskrit]]).

Module:languages/byTranslitModule finds the languages that use the module, and the translitModuleLangList function in Module:documentation lists them, and the categorize function in Module:module categorization adds categories for each one. This will only work if the transliteration module is listed in the language's data file or in the language's entry in Module:translit-redirect/data.