Jump to content

Module:Translations/doc

From Yezur Wiki
Revision as of 12:19, 27 August 2026 by Thiorosan (talk | contribs) (Create the documentation subpage)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This is the documentation page for Module:Translations

This is the documentation for Module:Translations, the translations-box renderer for the Yezur wiki. It is not called directly: Template:Translations invokes it with {{#invoke:Translations|render}} and the module reads the parameters given to that template. One box covers one English sense and lists the words the world's languages use for it, grouped by macro-family; boxes sit under a ====Translations==== heading following that sense's definitions, inside the English section of a Dictionary entry. Worked examples are at Template:Translations/testcases.

Parameters

Parameter Purpose
gloss The sense being translated, shown in italics after Translations and an em dash in the box heading. Required: a headword with several senses carries one box per sense, and the gloss is what keeps them apart. When it is omitted the heading reads no gloss given in the error style instead.
CODE A registry code from Module:Languages used as the parameter name — YAQ-HE, YBS-PJ, YCQ-BE — with that language's word for the sense as the value. Any number may be given. A single value may hold several synonyms separated by commas, each of which is linked separately.

Every named parameter other than gloss is read as a language code; codes are matched case-insensitively. Parameters with an empty value are skipped, as are positional parameters. A gloss given on its own still renders the heading and an otherwise empty box; the module returns nothing at all when it is given neither a gloss nor any language parameter.

Grouping and order

Each word is linked to its Dictionary entry through Module:Languages, which anchors the link to the language's section heading and prefixes an asterisk for reconstructed languages — the star comes from the registry, not from the wikitext. Group headings are the registry's family field; known codes carrying no family are gathered under Isolates.

Rows are sorted by the second letter of the code, which is the family, then by the third, which is the era (P proto, Q ancient, R medieval, S modern, so alphabetical order is also chronological), then by language name, then by the code itself. The second letter likewise picks the colour class, tfam- followed by that letter. Colours and layout come from Template:Translations/styles.css, which the module loads through TemplateStyles; it defines tfam-A to tfam-E for the five families and tfam-X for the isolate codes.

A code the registry does not know is not silently dropped. Its words are left unlinked and printed after all the family groups as unrecognized code CODE: word in red, so that a typo or a language missing from the registry shows on the page.

The box is display-only: it stores nothing and is hand-curated per sense, in the same way as the family Members tables.