Localization and Glossary Tools
Run, feed and check three review-first localization projects. Pick a multilingual model and a source language.
- Concepts and terms
- Tasks and commands
- Annotated code
- Diagrams
- Comparisons
- Defaults and numbers
- Troubleshooting
- Questions and tips
Three projects side by side#
| Factor | Subtitle Localization Desk | UI String Localization Workbench | Glossary Hovercard Publisher |
|---|---|---|---|
| Builds | Reviewed WebVTT and an HTML desk | Reviewed locale JSON and a preview | Annotated HTML lesson |
| Language | Python 3.10+ | Node 22.18 or newer | Node 22.18 or newer |
| Input keys | vtt, translations, glossary, cps | locale, messages, proposals, values | glossary, lesson |
| Outputs | review.html, translation-decisions.json, reviewed.vtt | locale.json, unresolved-strings.json, report.html | report.html, glossary.json, coverage.json |
| Review file | --decisions decisions.json | third argument locale-review.json | none |
| Hard gate | reviewed.vtt only when all cues approved | approve only with no issues | balanced HTML subset |
Build and grade your version#
| Task | Code |
|---|---|
| Make a starter | python3 scripts/ |
| Grade one stage | python3 scripts/ |
| Grade all stages | python3 scripts/ |
| Save a completion report | --report completion.json |
| Grade the reference | python3 scripts/ |
UI string workbench flow#
Error messages and fixes#
| Symptom | Cause | Fix |
|---|---|---|
stale review | Proposals or cps changed after review | Use the new decisions.json from review.html |
resolve glossary or acknowledge reading-budget overflow | Approved cue misses a term or the budget | Add the term or set override_budget to true |
STYLE and REGION are outside the supported subset | VTT has STYLE or REGION blocks | Remove them. NOTE blocks are ignored |
Placeholder multiset changed | Translation drops or adds a {name} | Keep every placeholder of the source |
Stale or invalid translation decision | Review translation differs from the proposal | Download a new locale-review.json |
Resolve translation issues or context before approving | Ambiguous key not acknowledged | Set acknowledgeContext to true |
Ambiguous repeated phrase | Same phrase in two terms | Give each phrase one term |
Unsupported HTML element | Tag outside the allowed subset | Use the listed tags only |
Defaults and limits#
| Setting | Default | Note |
|---|---|---|
cps | 17 | Must be positive and finite |
schema_version | 1 | In translation-decisions.json |
approved | False | Every cue starts unapproved |
override_budget | False | Needed for an over-budget approval |
| Proposal length | 2000 | Characters at most per proposal |
schemaVersion | 1 | Required in locale-review.json |
| Output folder | output | Second argument of the Node CLIs |
| Exit code on error | 2 | The Node CLIs print the message |
Run the reference#
| Command | What it does |
|---|---|
python3 cli.py samples/ | Subtitle desk on the sample |
python3 cli.py <input.json> --output <dir> | Subtitle desk on your input |
node cli.ts sample.json output | UI workbench or glossary publisher |
node cli.ts <input.json> <dir> <review.json> | UI workbench with your review |
node cli.ts --help | Prints the argument line |
Subtitle desk pipeline#
Subtitle input (samples/input.json)#
{ "vtt": "WEBVTT\n\nmap\n00:00.000 --> 00:03.000\nOpen the map.\n...", "translations": { "map": "Abre el map.",glossary turns it into "Abre el mapa." "label": "Escribe un nombre descriptivo ..."2 s at cps 12, budget 24 }, "glossary": {"map": "mapa", "marker": "marcador"},source to target "cps": 12optional, the default is 17}Glossary publisher rules#
- Term id
- lower case, matches
^[a-z][a-z0-9-]*$, and is unique. - Phrases
- a term or alias must not repeat across the glossary, in any case.
- Matching
matchTerms()tries the longest phrase first and needs word boundaries.- Skipped text
- text inside
pre,codeandastays untouched. - Attributes
- only
class,id,title,langandhrefona. - Links
hrefmust start withhttps://,http://or#.- Definition
- a native button with
aria-expandedshows arole="note"span.
Pick a multilingual model#
| Task | Code |
|---|---|
| Classification, 100 languages | XLM-R-base fine-tuned |
| Zero-shot classification | joeddav/ |
| Translation, 200 languages | facebook/ |
| Low-resource language | XLM-V or a related-language fine-tune |
| Few-shot epochs | num_train_epochs= |
| Few-shot learning rate | learning_rate= |
| Long-tail scripts | byte_fallback= |
Source language choice#
- Is English always the best source?
- No. Language similarity predicts transfer better than corpus size.
- Marathi target?
rank_source_languages()puts Hindi above English.- How many target labels?
- 100 to 500 examples give 95 to 98 percent of the English baseline.
- Why not a higher learning rate?
- The multilingual alignment collapses to an English-only model.
- What is the fertility tax?
- Hindi can need 3 to 5 times the tokens of English.
Tips#
- Report accuracy per language. An aggregate hides the long tail.
- Check tokenization fertility on target text before you train.
- Every translation needs a human review. The tools only flag problems.
- The UI workbench supports simple named placeholders, not ICU messages.
- Glossary phrases never cross elements or entity boundaries.
- The HTML runs locally and sends no data to a third-party service.