Skip to content
Webfold Docs
Esc
↑↓navigate↵open⌘Jpreview
On this page

Glossa

Extract, translate and verify every translatable string in your code, with a lockfile that merges without conflicts.

Glossa is a localisation engine in Rust. It reads translatable strings from your source code and resource files into one canonical form, fills missing translations, verifies them, and keeps everything in files that live in your repository. It installs both a glossa and a lingo command.

Quickstart

glossa init --locales es,fr,de,ja     # detects your framework
glossa extract
glossa check --ci --format=github     # fail CI on missing or unsafe translations

Commands

Command Does
glossa init Create the project configuration
glossa extract Extract all translatable units
glossa translate --provider P --locales L Translate missing keys. Providers: anthropic, openai, deepseek, ollama, ptyktos-api, offline
glossa check --ci [--format=github] Quality gate with GitHub Actions annotations
glossa codegen --target typescript|rust --output F Type-safe message accessors with no runtime
glossa visual --port 3920 A local in-context editor: Alt-click an element in your browser to edit its copy
glossa import Import Inlang, Tolgee, Crowdin or Lingo configuration
glossa diff Translation status without the network
glossa pseudo --locale pseudo Test UI expansion and clipping without spending tokens
glossa sync Export to JSON, YAML, PO, Fluent, XML, ARB or XLIFF

What it reads

React and Next.js JSX and TSX, Vue single-file components, Svelte, Solid, HTML templates, Markdown, iOS Swift, Android XML, Flutter, Python, Go, Ruby, PHP, and resource formats (JSON, YAML, PO, Fluent, XLIFF).

The integrity gate

Every translation is checked for slot parity (a dropped {count} is rejected), balanced markup tags, and injected HTML or scripts before it is accepted. The gate checks structure, not meaning.

Conflict-free lockfile

glossa.lock and lingo.lock merge in any order, so two people translating different features in parallel do not produce Git conflicts.

Hosted API

POST /v1/localization/check runs the integrity gate over source and translation pairs (variable slots, markup tags, injected scripts, and protected glossary terms) and returns a result per item. POST /v1/localization/extract lists the translatable strings in a file; the file name picks the parser. Translating itself stays in the CLI, with your own provider key.

curl -s https://api.webfold.ai/v1/localization/check \
  -H "Authorization: Bearer $WEBFOLD_API_KEY" -H "Content-Type: application/json" \
  -d '{"items":[{"key":"greeting","source":"Hello, {name}","translation":"Hola, {name}"}],"glossary":{"Webfold":"Webfold"}}'