glossary — Glossary (zero code)
A zero-code plugin: just write one
terms.json, no Python.
Declaration
{
"id": "workshop.glossary.elden_ring",
"name": "《艾尔登法环》游戏专有术语库",
"version": "1.1.0",
"target_app_version": "0.2",
"author": "TransBox",
"type": "glossary",
"entrypoint": "terms.json",
"supported_langs": ["en", "zh", "ja"],
"enabled": false
}enabled defaults to false: the user has to switch the glossary on manually in the Extension Workshop before it takes part in recognition and translation.
terms.json — the only format
The content must be an array of objects. Each entry has four non-empty string fields:
| Field | Meaning |
|---|---|
src | Source term |
tgt | The translation for this direction, must be a string |
src_lang | Source language, e.g. en / zh / ja |
tgt_lang | Target language |
[
{"src": "Malenia", "tgt": "玛莲妮亚", "src_lang": "en", "tgt_lang": "zh"},
{"src": "Malenia", "tgt": "マレニア", "src_lang": "en", "tgt_lang": "ja"},
{"src": "マレニア", "tgt": "玛莲妮亚", "src_lang": "ja", "tgt_lang": "zh"}
]The other direction of the same source term needs its own entry (the three above are the two entries for Malenia plus one for マレニア).
Matching rules: English source terms match on word boundaries; space-less languages such as Chinese, Japanese and Korean match on substrings.
Full reference: extensions/example_glossary_gaming/terms.json.
What the host does once it is enabled
The host uses the entries for the current language direction in three places:
- ASR hotwords (improves recognition accuracy)
- Pre-translation replacement / post-translation correction
- Injection into the MT engine's
glossary_context(if the MT plugin declaressupports_glossaryor is inferred as glossary-friendly from its type/tags)
While the plugin is disabled it takes part in none of these steps.
❌ These formats load as an empty table
- A flat dictionary
{"Malenia": "玛莲妮亚"} tgtwritten as an object or an array- Language pairs grouped
{"en-zh": {...}} terms.txt/tsv/ CSV- A dictionary grouped by language pair
The contract is the single array form shown above. Never teach any other format in docs or examples.
Related
- Layout & mod.json —
supported_langsand other fields - i18n language pack — UI translation (not a glossary)
- Example library
