Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

434 Commits

Repository files navigation

Universal Unity Game Translator (Beta)

Website:unitygametranslator.asymptomatikgames.combrowse game translations · user documentation

A mod that players install into any Unity game to play it in their language — the game doesn't need to support it, and the developer doesn't need to do anything. Use translations shared by the community, or translate live with your own AI: a free local server (Ollama, LM Studio — Vulkan covers NVIDIA, AMD and Intel GPUs) if your machine can run the game and the model together, or any OpenAI-compatible online provider (Groq, Gemini, OpenAI, OpenRouter…), Google Translate or DeepL with your own key. Fully offline with a local AI: no API key, no internet, no cost. Supports all writing systems and any language direction.

This README covers the technical side (installation details, configuration, self-hosting, building). For the user guide — setup wizard, editors, collaboration, troubleshooting — see the documentation on the website.

Features

Translation Engine

  • Runtime translation — text is translated as you encounter it in-game
  • Multiple backends — community downloads only, free local AI, or online services with your own key (OpenAI-compatible providers, Google Translate, DeepL)
  • Instant cache hits — cached translations apply synchronously with zero latency
  • Number normalization — "Kill 5 enemies" and "Kill 10 enemies" share the same translation
  • Auto language detection — detects system language as default target
  • Cross-platform — Windows, macOS, Linux

Translation Backends

BackendDescription
AI (LLM)Any OpenAI-compatible server — local or cloud (Ollama, LM Studio, Groq, Gemini, OpenAI, OpenRouter, and any other compatible provider)
Google TranslateGoogle Cloud Translation API
DeepLDeepL API (Free and Pro tiers)
NoneOnly use cached/downloaded translations

Editing Tools

  • In-game text editor — click any UI element, edit its texts in place (saved with the Human tag), or retranslate them with AI. Found in Translation Tools → Tools → Start Text Editor
  • Browser live edit — open your local translation file in a full web editor while playing: search & replace, filters, quality bar, keyboard review. Every save is hot-reloaded in-game, and new AI translations appear in the browser as you play. No account needed, nothing is published
  • Private AI retranslation from the browser — the website only calls your mod, which translates with your own locally-configured backend. No API key or LLM configuration ever reaches the website

Font System

  • Automatic font detection (TextMeshPro, Unity UI.Text)
  • Fallback fonts for any writing system — Latin, CJK, Arabic, Devanagari, Cyrillic, Thai, Hebrew, and more
  • Per-font scaling and enable/disable
  • Font overrides by pattern — override size for specific UI elements (tables, titles, tooltips)
    • Add overrides via inspector click, text search, or manual pattern
    • Supports recursive patterns (path:**/TablePanel/**)
    • Changes apply at runtime

UI Exclusions

  • Pattern-based exclusion system for text that shouldn't be translated (chat, player names, etc.)
  • Visual inspector to click and exclude elements
  • Find by text content search
  • Wildcard patterns (**/ChatPanel/**, */PlayerName)

Image/Sprite Replacement

  • Replace text embedded in sprites/images with translated versions
  • Visual inspector to select and export original images
  • Import translated images as replacement
  • Sprite metadata (pivot, borders, PPU) preserved

Dynamic Variables

  • Extract player name, item stats, and other dynamic values from game objects
  • Placeholder substitution for better cache reuse
  • Variable scanner to discover candidates

Online Community Features

  • Community translations — download game translations from the website
  • Automatic game detection — via Steam ID, product name, or folder
  • Real-time sync via SSE (Server-Sent Events) — get updates without restarting
  • 3-way merge — intelligently merge remote updates with your local changes
  • Device Flow login — secure authentication without entering passwords in-game
  • Upload & share — share your translations with the community
  • Mod update checker — notifications when a new mod version is available; stable releases by default, opt-in for beta (pre-release) builds

Collaboration System (Main/Branch/Fork)

TermDescription
MainThe reference translation, owned by its creator and public on the website.
BranchYour improvements to someone else's Main, sent to the owner for review. One per user per UUID.
ForkYour own independent translation (new lineage): you become its Main owner, no longer linked to the original.

Upload behavior:

SituationResult
UUID doesn't exist on serverCreates new Main
UUID exists, you're the ownerUpdates your Main
UUID exists, owned by someone elseCreates your Branch (the owner reviews and merges)
"Create Independent" / Fork in the modNew UUID → new Main owned by you

Translation tags (H/V/A/S)

TagNameDescription
HHumanWritten by a human
VValidatedMachine wording a human read and accepted
AAIMachine wording nobody has read yet
SSkipA human ruled that this line stays as it is — a fictional language, a proper name, text that must not change. Counts as settled, never as work left to do
MModMod UI translations (internal, never counted)

The mod shows a review stage rather than a mark — (H + V + S) / (H + V + S + A), read as "machine translation / review started / well under way / fully reviewed". Every translation begins as machine output, which is a starting point and not a failing grade, so there is no scale ending at "excellent" to fall short of. A file with nothing translated has no stage at all.

The full set of measures, and who sees each, is published at /docs.

Capture Keys Only mode — play without translating, capture all text, then translate manually on the website for 100% human translations.

In-Game Overlay

  • First-run wizard — guided setup on first launch
  • Settings hotkey — F10 (configurable) opens the full settings panel
  • Translation info — H/V/A/S distribution, review stage, lines left to review, sync status
  • Translation Tools — tabs for Tools (editors), Exclusions, Fonts (Global + Overrides), Images, Variables
  • Merge panel — resolve conflicts with per-entry Keep Mine / Take Server choices
  • Status overlay — corner notifications for updates, sync, and AI queue

Note: Only text displayed during gameplay is translated. Play through the game to build the translation cache.

Installation

1. Install a mod loader

Mod LoaderUnity TypeDownload
BepInEx 5MonoGitHub
BepInEx 6Mono or IL2CPPBleeding Edge
MelonLoaderMono or IL2CPPGitHub

How to identify your game type:

  • GameAssembly.dll in game folder → IL2CPP
  • <Game>_Data/Managed/Assembly-CSharp.dllMono

Cross-platform: The mod's DLLs are .NET assemblies that work on Windows, macOS, and Linux.

2. Install UnityGameTranslator

Download the release matching your mod loader from GitHub Releases and extract to:

Mod LoaderExtract DLLs toUser data (config, translations, fonts, images)
BepInEx<Game>/BepInEx/plugins/UnityGameTranslator/Same folder as the DLL
MelonLoader<Game>/Mods/ (DLLs directly, no subfolder)<Game>/UserData/UnityGameTranslator/

MelonLoader warning: Do NOT place the DLLs inside Mods/UnityGameTranslator/. MelonLoader only scans the root Mods/ folder and will not find mods inside subdirectories.

3. First Launch

The mod displays a setup wizard:

  1. Online mode — enable community features or stay offline
  2. Settings hotkey — pick a key to open settings (default: F10)
  3. Translation search — search for existing community translations
  4. AI setup — configure translation backend and model (optional)

4. Enable translation backend (optional)

By default, the mod only uses cached/downloaded translations. To enable live translation:

AI Translation (OpenAI-compatible API)

The mod works with any server that exposes the OpenAI-compatible API (/v1/chat/completions). This includes local servers, cloud providers, and an ever-growing list of AI platforms.

Examples (non-exhaustive):

ServerURL to enterAPI key
Ollama (local)http://localhost:11434None
LM Studio (local)http://localhost:1234None
Groqhttps://api.groq.com/openaiRequired (free tier)
OpenRouterhttps://openrouter.ai/apiRequired (free tier)
OpenAIhttps://api.openai.comRequired
Google Geminihttps://generativelanguage.googleapis.com/v1beta/openai/chat/completionsRequired (free tier)

URL resolution: The mod auto-appends /v1/chat/completions if the URL doesn't already end with /completions. If your provider has a non-standard URL, enter the full path up to /chat/completions.

Commercial translation APIs

ProviderDescription
Google TranslateCloud Translation API
DeepLFree and Pro tiers

Setup: Open the mod panel (F10) → Mod Options → Translation tab → select backend → enter URL/key → Test → Enable.

Recommended local model:qwen3:8b — best balance of speed, quality, and multilingual support (~6-8 GB VRAM).

Configuration

Config file location:

  • BepInEx: <Game>/BepInEx/plugins/UnityGameTranslator/config.json
  • MelonLoader: <Game>/UserData/UnityGameTranslator/config.json

Translation cache: translations.json in the same folder.

Key Options

OptionDescription
translation_backend"llm", "google", "deepl", or "none"
target_language"auto" (system language) or specific (e.g., "French")
game_contextGame description for better AI translations (e.g., "Medieval fantasy RPG")
settings_hotkeyKey to open settings (default: "F10")
online_modeEnable community features (sync, upload)
sync.merge_strategy"ask", "merge", or "replace"

External Resources (Fonts & Images)

UnityGameTranslator can use custom fonts and replacement images to improve translation quality — especially useful for languages with characters not supported by the game's default font, or when translating text baked into images (logos, buttons, title screens).

Where to place external resources:

Mod LoaderFonts folderImages folder
BepInEx<Game>/BepInEx/plugins/UnityGameTranslator/fonts/<Game>/BepInEx/plugins/UnityGameTranslator/images/
MelonLoader<Game>/UserData/UnityGameTranslator/fonts/<Game>/UserData/UnityGameTranslator/images/

Custom fonts — drop .ttf or .otf files into the fonts/ folder. The filename (without extension) becomes the font name shown in the Translation Parameters panel. Assign per UI element or globally.

Replacement images — drop .png files (with transparency) into the images/ folder. Use the in-game image capture feature to export existing sprites, edit them externally, then save the modified versions back.

External resources are fully optional. The mod works perfectly without them.

Self-Hosting

Deploy your own website instance, then update Directory.Build.props before building:

<ApiBaseUrl>https://your-server.com/api/v1</ApiBaseUrl>
<WebsiteBaseUrl>https://your-server.com</WebsiteBaseUrl>
<SseBaseUrl>https://sse.your-server.com</SseBaseUrl>

Or override at runtime in config.json:

{
"api_base_url": "https://your-server.com/api/v1",
"website_base_url": "https://your-server.com"
}

Security: Your API token is sent to the configured server. Only use trusted instances.

Building from Source

Prerequisites

  • .NET SDK 6.0+
  • extlibs/ folder with Unity, BepInEx, MelonLoader, and UniverseLib DLLs (see project structure)

Build

./prepare-release.ps1

Creates release zips in releases/ for all 5 mod loader variants.

Project Structure

UnityGameTranslator/
├── UnityGameTranslator.Core/ # Shared translation engine
│ ├── TranslatorCore.cs # Main logic, config, translation cache
│ ├── TranslatorPatches.cs # Harmony patches for text interception
│ ├── TranslatorScanner.cs # Scene scanning for UI components
│ ├── FontManager.cs # Font detection, replacement, scaling, overrides
│ ├── ImageReplacer.cs # Sprite/image replacement for bitmap text
│ ├── VariableManager.cs # Dynamic variable extraction
│ ├── ApiClient.cs # HTTP client for website API
│ ├── SseClient.cs # SSE streaming for real-time sync
│ ├── TranslationMerger.cs # 3-way merge with tag awareness
│ ├── GameDetector.cs # Game identification (Steam ID, product name)
│ ├── GitHubUpdateChecker.cs # Mod version update checker
│ ├── TokenProtection.cs # AES-256 token encryption
│ └── UI/ # UniverseLib uGUI overlay
│ ├── Panels/ # 12 panels (wizard, settings, merge, inspector...)
│ └── Components/ # Reusable UI components
├── UniverseLib/ # Git submodule (yukieiji fork)
├── UnityGameTranslator-BepInEx5/ # BepInEx 5 adapter (Mono)
├── UnityGameTranslator-BepInEx6-Mono/ # BepInEx 6 adapter (Mono)
├── UnityGameTranslator-BepInEx6-IL2CPP/# BepInEx 6 adapter (IL2CPP)
├── UnityGameTranslator-MelonLoader-Mono/ # MelonLoader adapter (Mono)
├── UnityGameTranslator-MelonLoader-IL2CPP/ # MelonLoader adapter (IL2CPP)
└── Directory.Build.props # Version + API URLs

Acknowledgments

  • UniverseLib by sinai-dev & yukieiji — UI framework for Unity mods
  • BepInEx — Unity plugin framework
  • MelonLoader by LavaGang — Universal Unity mod loader
  • Harmony by Andreas Pardeike — Runtime method patching
  • Newtonsoft.Json by James Newton-King — JSON framework

See THIRD_PARTY_LICENSES.md for full license details.

License

Dual-licensed:

  • Open Source:AGPL-3.0
  • Commercial: Contact us for proprietary use

See LICENSING.md for details.

About

Universal Unity games automatic local AI translation and communtity sharing and improvments

Topics

Resources

Code of conduct

Contributing

Stars

20 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages