Dragoman Mascot
こんにちは世界
¡Hola Mundo!
Open Source Tool

dragoman

AI-powered translation for structured documents. Feed it any file format — get back perfectly translated files with every key, tag, and placeholder intact.

MIT · Go ·CLI + Library
Scroll
What is Dragoman?

Your documents, any language

D ragoman is a Go library and CLI tool that translates structured documents in any file format using AI while preserving their exact structure. Keys stay keys, tags stay tags, placeholders remain untouched. Only the human-readable text gets translated, with full context awareness for accurate, natural results.

Whether you maintain a Nuxt app with 27 language files or ship a SaaS product with YAML configs, dragoman handles incremental updates, term preservation, and large-document chunking out of the box. Use it from the terminal or embed it directly in your Go applications.

How It Works

Three steps to any language

No complex setup, no configuration files. Point dragoman at your document and tell it the target language.

1

Feed your document

Pass any structured file. Dragoman auto-detects the format and source language, then parses the document structure.

2

AI translates the values

Using OpenAI, dragoman translates only the text content. Keys, attributes, tags, and placeholders are left completely untouched.

3

Get your translation

Receive a perfectly structured translation — identical shape to the original, ready to drop into your project.

en.jsonSource
{
  "greeting": "Hello",
  "farewell": "Goodbye",
  "menu": {
    "home": "Home",
    "about": "About us",
    "contact": "Get in touch"
  }
}
de.jsonTranslated
{
  "greeting": "Hallo",
  "farewell": "Auf Wiedersehen",
  "menu": {
    "home": "Startseite",
    "about": "Über uns",
    "contact": "Kontakt aufnehmen"
  }
}
Capabilities

Built for real translation workflows

Structure Preservation

Keys, tags, anchors, attributes, and template placeholders remain exactly as they are regardless of format. Only human-readable values get translated.

Multi-Format Support

Works with any structured file format out of the box. Auto-detects the format and handles nested structures of any depth.

Incremental Updates

Use update mode to translate only new or missing keys. Already-translated content is skipped, saving time and API costs.

Term Preservation

Keep brand names, technical terms, and specific phrases unchanged during translation with the --preserve flag.

Language Auto-Detection

The source language is automatically detected from the content. No need to manually specify it unless you want to.

CLI + Go Library

Use dragoman from the terminal for quick translations, or import it as a Go package and embed translation logic in your applications.

Smart Chunking

Large documents are automatically split into chunks that fit within the AI model's context window, then reassembled seamlessly.

Context-Aware AI

Powered by OpenAI, translations understand context, tone, and domain — delivering natural results, not word-for-word substitutions.

Supported Formats

Every format you work with

Dragoman handles any structured document format used in modern software development.

.json

i18n locale files, API responses, config files — dragoman preserves every key and nested structure during translation.

.xml

XLIFF, Android strings, SVG text, SOAP payloads — tags and attributes stay intact while text nodes get translated.

.yaml

Kubernetes configs, Rails locales, Hugo content files — indentation and anchors are preserved perfectly.

Command Line

Translate from your terminal

A single command is all it takes. Pipe, redirect, or write directly to files.

terminal
# Translate a JSON file from English to German
$ dragoman locales/en.json --to de --out locales/de.json

Translating en → de ...
 42 keys translated
 Structure preserved
 Written to locales/de.json

# Only translate new or missing keys
$ dragoman locales/en.json --to de --update locales/de.json

Comparing source with existing translation...
 8 new keys found
 34 keys skipped (already translated)
 Updated locales/de.json

# Preserve specific terms during translation
$ dragoman config.yaml --to ja --preserve "Dragoman,API,OAuth"

Translating en → ja ...
 Terms preserved: Dragoman, API, OAuth
 Written to stdout

Install via Go

go install github.com/modernice/dragoman/cmd/dragoman@latest
Open Source

Free and open source

dragoman is MIT-licensed and actively maintained. Contributions, issues, and feedback are always welcome.

License

MIT

Language

Go

Commits

171+

Formats

JSON, XML, YAML

View on GitHub

Frequently Asked Questions

Everything you need to know about dragoman.

Dragoman uses the OpenAI API (GPT models) for translations. You'll need an OpenAI API key set as the OPENAI_API_KEY environment variable.

Yes. Use the --update flag to translate only new or missing keys in an existing translation file. Already-translated content is preserved.

Absolutely. Use the --preserve flag followed by a comma-separated list of terms. Brand names, technical terms, or any phrase you specify will remain unchanged.

Dragoman automatically splits large documents into chunks that fit within the model's context window, translates each chunk, and reassembles the result into a single output.

Yes. Import github.com/modernice/dragoman and use it programmatically in your Go applications. The library exposes the same functionality as the CLI.

Dragoman itself is free and MIT-licensed. However, it uses the OpenAI API for translations, which has its own pricing based on usage.

Get in Touch

Now that you've learned about our process, why not take the next step and let us help you take your online presence to the next level? Don't wait – schedule a call with us today and let's discuss how we can give your business the recognition it deserves.