Foreign Server Translator 是一个 Mindustry 纯客户端 Java 模组,用来在外语服务器中自动翻译聊天。
它不会修改服务器,也不需要服务器安装。玩家在多人服务器列表(已保存服务器、局域网发现、公网服务器浏览)中把某个服务器标记为外语服务器后,进入该服务器时会启用翻译:除聊天外,还包括服务器界面文本、世界文本(逻辑消息方块)与地图目标标记。
- 在多人服务器列表(已保存服务器、局域网发现、公网服务器浏览)的所有服务器卡片上增加外语服务器开关按钮(眼睛图标)。
- 对已标记服务器启用翻译,不影响普通服务器。
- 读取其他玩家的聊天消息并翻译成本地目标语言,译文会显示在原消息下方。
- 翻译请求发出后先显示占位行
=>...,翻译完成后替换该行,避免异步延迟导致译文错位。 - 拦截自己按 Enter 发送的聊天,翻译成服务器语言后再发送。
- 默认发送目标语言为英文;也可以用
'RU text、'JP text、'JR text等语言代码临时指定目标语言。 - 语言代码前缀只影响当前消息;OpenAI prompt 与 Microsoft 翻译目标都会按本次前缀临时覆盖。
- 保留
/t与/a聊天前缀。 - 翻译服务器界面文本(公告、弹窗、菜单、输入提示、状态提示等),译文显示在原文本旁;悬停逻辑消息方块时会在方块上方显示译文。
- 翻译地图任务目标标记(TextMarker / ShapeTextMarker)的文本,可为其单独配置 OpenAI 接口(见下方
Marker 翻译设置)。 - OpenAI 模式下自动检测服务器语言并缓存;翻译结果按服务器缓存,最多保留 1500 条。
- 默认使用 Microsoft Translator。
- 可填写 OpenAI 兼容接口的
base_url、apikey、model来改用 AI 翻译。 - OpenAI 模式会附带可配置数量的前文消息,默认 3 条。
- 可选启用 Mindustry bundle key 匹配,把匹配到的本地化 key 作为术语提示加入 Prompt;也可以改为把完整的源/目标语言 bundle 术语表加入 Prompt(开启后优先于匹配提示)。
- 设置界面支持中英文 i18n。
- 语言选择项会自动读取 Microsoft 支持的语言列表,失败时使用内置回退列表(按需加载)。
- 统计输入/输出 token 用量,显示 1 天、1 周、总计三列(优先读取 API usage 字段,缺失时本地估算)。
- 从 GitHub Releases 下载
ForeignServerTranslator.jar。 - 将文件放入 Mindustry 的
mods目录。 - 重启游戏并启用该模组。
安卓端同样使用 Release 中的 ForeignServerTranslator.jar,该包包含 classes.dex。
- 打开多人服务器列表(已保存服务器、局域网发现、公网服务器浏览均可)。
- 在目标服务器卡片上点击外语服务器按钮(眼睛图标)。
- 进入该服务器后,其他玩家消息会自动翻译并显示在原消息下方;公告、弹窗等服务器界面文本与地图目标标记也会被翻译,悬停逻辑消息方块可查看译文。
- 直接发送中文消息时,模组会先翻译成默认发送目标语言再发出。
- 需要临时指定目标语言时,在消息前加语言代码,例如:
'RU 你好
'JP 你好
'JR 你好
进入 设置 -> 模组 -> 外语服务器翻译:
使用 OpenAI 兼容翻译:关闭时使用 Microsoft Translator;开启后必须填写 Base URL 和 API Key。OpenAI 兼容接口 Base URL:仅开启 OpenAI 兼容翻译时需要。OpenAI 兼容接口 API Key:仅开启 OpenAI 兼容翻译时需要。OpenAI 兼容接口模型:OpenAI 兼容接口使用的模型名。收到消息翻译为:其他玩家消息、服务器界面/世界文本与目标标记的译文语言。默认发送目标语言:自己发送消息时默认翻译成的语言。OpenAI 前文消息数:传给 AI 的历史聊天条数。将匹配到的 bundle key 加入 OpenAI 提示词:把匹配到的 Mindustry 本地化 key 作为翻译提示。将完整 Mindustry bundle 术语表加入 OpenAI 提示词:发送完整的源/目标语言 key 对齐术语表;开启后优先于匹配提示。翻译缓存:显示已检测服务器语言与翻译条目数量,可分别清空服务器语言缓存与翻译缓存。Token 用量:显示输入/输出 token 的 1 天、1 周、总计统计(优先读取 API usage,缺失时本地估算)。Marker 翻译分组:为地图目标标记翻译单独配置,包括Marker 翻译使用 OpenAI 兼容翻译、Marker 翻译 OpenAI 兼容接口 Base URL、Marker 翻译 OpenAI 兼容接口 API Key、Marker 翻译 OpenAI 兼容接口模型,默认使用 Microsoft Translator。
启用翻译时,聊天、服务器界面文本、世界文本与地图目标标记的文本会发送给你选择的翻译服务。默认服务为 Microsoft Translator;如果开启了 OpenAI 兼容翻译,文本会发送到你填写的接口地址,OpenAI 模式下的服务器语言检测同样会发送文本。
./gradlew deploy主要输出:
dist/ForeignServerTranslator.jardist/ForeignServerTranslator.zip../构建/ForeignServerTranslator/ForeignServerTranslator-<version>.jar../构建/ForeignServerTranslator/ForeignServerTranslator-<version>.zip
Foreign Server Translator is a client-side Java mod for Mindustry that translates chat on marked foreign-language servers.
It does not modify the server and does not require server-side installation. Mark a server as foreign-language in the multiplayer server list (saved servers, LAN discovery, or the public server browser), then the mod enables translation when you join it: chat, server UI text, world text (logic message blocks), and map objective markers.
- Adds a foreign-language toggle button (eye icon) to every server card in the multiplayer lists (saved servers, LAN discovery, and the public server browser).
- Enables translation only for marked servers.
- Translates messages from other players and shows the translation under the original message.
- Shows a
=>...placeholder immediately and replaces it when the async translation finishes, keeping translations aligned with their source messages. - Intercepts your chat after pressing Enter, translates it to the server language, then sends the translated message.
- Defaults outgoing translation to English; language-code prefixes such as
'RU text,'JP text, and'JR textoverride the target language for one message. - Language-code prefixes affect only the current message; the OpenAI prompt and Microsoft translation target are temporarily overridden for that send.
- Preserves
/tand/achat prefixes. - Translates server UI text (announcements, popups, menus, prompts, status toasts), showing the translation beside the original; hovering a logic message block shows a translated overlay above it.
- Translates map objective marker text (TextMarker / ShapeTextMarker), with an independent OpenAI configuration (see the
Marker Translationsettings group below). - In OpenAI mode, detects and caches the server language automatically; translations are cached per server, up to 1500 entries.
- Uses Microsoft Translator by default.
- Supports OpenAI-compatible translation by setting
base_url,apikey, andmodel. - Sends configurable previous chat context to OpenAI-compatible models; default is 3 messages.
- Optional Mindustry bundle-key hint matching for better terminology in AI translation prompts; alternatively sends a complete key-aligned source/target bundle glossary (overrides matched bundle hints).
- Bilingual settings UI.
- Language options are populated from Microsoft's supported translation languages (loaded on demand), with a built-in fallback list.
- Tracks input/output token usage for 1 day, 1 week, and total (reads API usage fields when available; falls back to local estimation).
- Download
ForeignServerTranslator.jarfrom GitHub Releases. - Put it into Mindustry's
modsdirectory. - Restart the game and enable the mod.
Android uses the same ForeignServerTranslator.jar from Releases; it includes classes.dex.
- Open the multiplayer server list (saved servers, LAN discovery, or the public server browser).
- Click the foreign-language toggle (eye icon) on the target server card.
- Join the server; messages from other players will be translated under the original line. Announcements, popups, and other server UI text plus map objective markers are translated as well; hovering a logic message block shows its translation.
- Send chat normally; the mod translates your message to the default outgoing language before sending.
- Prefix a message with a language code to override the target language for that message:
'RU Hello
'JP Hello
'JR Hello
Open Settings -> Mods -> Foreign Server Translator:
Use OpenAI compatible translation: disable to use Microsoft Translator; enable and fill in Base URL and API key to use OpenAI.OpenAI compatible base URL: required only when OpenAI-compatible translation is enabled.OpenAI compatible API key: required only when OpenAI-compatible translation is enabled.OpenAI compatible model: model name used by OpenAI-compatible translation.Translate received chat to: target language for incoming chat, server UI/world text, and marker translations.Default language to send: default language for outgoing chat.OpenAI context messages: number of previous messages sent as context.Add matched bundle keys to OpenAI prompt: adds matched Mindustry bundle keys as terminology hints.Add full Mindustry bundle glossary to OpenAI prompt: sends a complete key-aligned source/target bundle glossary; this overrides matched bundle hints.Translation cache: shows counts of detected server languages and translation entries, with buttons to clear server-language and translation caches.Token usage: input/output token usage for 1 day, 1 week, and total (reads API usage fields when available; falls back to local estimation).Marker Translationgroup: independent configuration for map objective marker translation, includingUse OpenAI for marker translation,Marker translation OpenAI base URL,Marker translation OpenAI API key, andMarker translation OpenAI model; defaults to Microsoft Translator.
When translation is enabled, chat, server UI text, world text, and map marker text are sent to the selected translation service. The default service is Microsoft Translator. If OpenAI-compatible translation is enabled, text is sent to the endpoint you provide; OpenAI-mode server language detection also sends text.
./gradlew deployOutputs:
dist/ForeignServerTranslator.jardist/ForeignServerTranslator.zip../构建/ForeignServerTranslator/ForeignServerTranslator-<version>.jar../构建/ForeignServerTranslator/ForeignServerTranslator-<version>.zip