Skip to content

glossary — Glossary (zero code) ​

A zero-code plugin: just write one terms.json, no Python.


Declaration ​

json
{
  "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:

FieldMeaning
srcSource term
tgtThe translation for this direction, must be a string
src_langSource language, e.g. en / zh / ja
tgt_langTarget language
json
[
  {"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:

  1. ASR hotwords (improves recognition accuracy)
  2. Pre-translation replacement / post-translation correction
  3. Injection into the MT engine's glossary_context (if the MT plugin declares supports_glossary or 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": "玛莲妮亚"}
  • tgt written 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.


TransBox — empowering borderless cross-language communication for everyone