Skip to content

Reference

Europe: English, French, German, Spanish, Portuguese, Italian, Dutch, Danish, Swedish, Norwegian, Finnish, Polish, Czech, Slovak, Slovenian, Croatian, Serbian, Albanian, Bulgarian, Romanian, Hungarian, Estonian, Latvian, Lithuanian, Macedonian, Maltese, Greek, Irish, Scottish Gaelic, Galician, Catalan, Welsh.

Asia: Japanese, Chinese (Simplified), Chinese (Traditional), Korean, Hindi, Bengali, Gujarati, Kannada, Malayalam, Marathi, Tamil, Telugu, Urdu, Thai, Vietnamese, Indonesian, Malay, Persian.

Other: Arabic, Hebrew, Turkish, Ukrainian, Russian, Swahili, Afrikaans.

Language resolution is case-insensitive and accepts both codes (en, ja, zh-Hant) and full names (English, Japanese, Chinese (Traditional)). Underscores are normalized to hyphens.

ModelSizeSpeedQuality
translategemma:4b3.3 GB~300msGood
translategemma:12b8.1 GB~600msGreat (default)
translategemma:27b17 GB~1.5sBest
MetricValue
First translation (cold model load)~15s
Subsequent translations~600ms
VRAM usage~8.1 GB
Long text (per chunk)~600ms
MCP Client (Claude Code, etc.)
|
| MCP protocol (stdio)
v
+--------------------+
| index.ts | MCP server -- 5 tools: translate, translate_markdown,
| | translate_all, list_languages, check_status
+--------------------+
| translate.ts | Prompt building, chunking, batch mode, streaming
+--------------------+
| translateMarkdown | Markdown-aware segmentation, table parsing, reassembly
+--------------------+
| translateAll.ts | Multi-language orchestrator with nav bar injection
+--------------------+
| semaphore.ts | Counting semaphore for GPU-safe concurrency
+--------------------+
| validate.ts | Output validation (empty, echo, truncation, garble)
+--------------------+
| ollama.ts | HTTP client -- auto-start, auto-pull, retry, streaming
+--------------------+
| cache.ts | Segment cache + fuzzy translation memory
+--------------------+
| glossary.ts | Software term dictionary
+--------------------+
| polish.ts | Post-translation artifact cleanup
+--------------------+
| languages.ts | 57 language definitions
+--------------------+
| errors.ts | PolyglotError structured error class
+--------------------+
|
| HTTP (localhost:11434)
v
Ollama + TranslateGemma (GPU)
VariableDefaultDescription
POLYGLOT_MODELtranslategemma:12bDefault Ollama model for all translations
POLYGLOT_CONCURRENCY1Maximum concurrent Ollama requests (prevents GPU OOM)
FlagDescription
--version, -VPrint version and exit
AspectDetail
Data touchedText sent to local Ollama API (localhost:11434), .polyglot-cache.json segment cache
Data NOT touchedNo files outside working directory, no browser data, no OS credentials
NetworkHTTP to localhost:11434 only — zero external/internet egress
TelemetryNone collected or sent
Cache safetyCache path traversal is blocked — the cache file must stay within the same directory as the source file
Terminal window
npm install # install deps
npm run typecheck # type-check without emitting
npm test # run 256 unit tests (vitest)
npm run build # compile TypeScript to dist/
npm run verify # typecheck + test + build + pack (full gate)

The package exposes individual module exports for programmatic use:

ExportModule
@mcptoolshop/polyglot-mcpMain MCP server entry point
@mcptoolshop/polyglot-mcp/translateCore translate + translateBatch
@mcptoolshop/polyglot-mcp/translateMarkdownMarkdown-aware translation
@mcptoolshop/polyglot-mcp/translateAllMulti-language orchestrator
@mcptoolshop/polyglot-mcp/validateOutput validation
@mcptoolshop/polyglot-mcp/ollamaOllama HTTP client
@mcptoolshop/polyglot-mcp/languagesLanguage definitions + resolver
@mcptoolshop/polyglot-mcp/glossarySoftware glossary
@mcptoolshop/polyglot-mcp/polishPost-translation cleanup
@mcptoolshop/polyglot-mcp/cacheSegment cache + fuzzy matching
@mcptoolshop/polyglot-mcp/semaphoreCounting semaphore