$ account xxnuo
MTranServer is a high-performance, offline machine translation server that provides a REST API, web UI, and desktop Electron application. It leverages Mozilla's Bergamot (Marian NMT) engine compiled to WebAssembly for on-device translation, with no GPU required and average response times around 50ms. The server supports major world languages, language auto-detection via CLD2 (also compiled to WASM), and offers compatibility endpoints for popular browser translation plugins such as Immersive Translate, DeepL, Google Translate, and Kiss Translator. The architecture is a TypeScript/Node.js monolith using Express with tsoa for typed controllers and Swagger generation, a React frontend with shadcn/ui, and an Electron desktop wrapper. The system includes model auto-downloading, LRU caching, worker-per-language concurrency, and offline mode. The repository contains a large deprecated codebase (Go, Node.js v1, Rust, C++ versions) which is not actively used but remains in the source tree, potentially causing confusion. The active code is well-structured and follows modern TypeScript practices, though some vendored dependencies (CLD2, Bergamot) are old and have been compiled to WASM to mitigate drift.