Glossary
Control how specific terms are translated across your project. Define preferred translations, mark brand names as “do not translate,” and add context to guide the LLM.
How it works
Glossary terms are stored in a polyglot-glossary.yaml file in your project root. When strings are sent for translation, matching glossary terms are included as instructions to the LLM, ensuring consistent and accurate translations.
Managing terms
Add a term with a preferred translation
polyglot glossary add \
--term "Dashboard" \
--translation "Tableau de bord" \
--lang fr \
--context "Main navigation section header"Mark a term as “do not translate”
polyglot glossary add \
--term "Polyglot" \
--do-not-translateList all terms
polyglot glossary list
┌────────────┬────────────────────┬──────┬─────────────────────────┐
│ Term │ Translation │ Lang │ Context │
├────────────┼────────────────────┼──────┼─────────────────────────┤
│ Dashboard │ Tableau de bord │ fr │ Main navigation header │
│ Polyglot │ (do not translate) │ all │ │
└────────────┴────────────────────┴──────┴─────────────────────────┘Remove a term
polyglot glossary remove --term "Dashboard"Import from CSV
Bulk-import terms from a CSV file with columns: term, translation, lang, context, do_not_translate.
polyglot glossary import --file glossary.csvFile format
The polyglot-glossary.yaml file is a simple YAML list:
- term: Dashboard
translations:
fr: Tableau de bord
es: Panel de control
context: Main navigation section header
- term: Polyglot
do_not_translate: true
- term: Sign up
translations:
fr: S'inscrire
de: RegistrierenDashboard management
You can also manage glossary terms from the dashboard glossary page . Terms sync between the CLI and dashboard via the API.
Best practices
- Add brand names, product features, and technical terms early — before your first translation run.
- Use the
contextfield to disambiguate terms that have multiple meanings (e.g. “Run” as a verb vs. noun). - Mark all proper nouns and brand names as
do_not_translate. - Commit
polyglot-glossary.yamlto version control so the whole team shares the same glossary.