TranslationAPI

版本 v0.1.0·更新於 2026-07-16

Allows mods to translate text boxes. Does nothing on its own.

模組介紹 作者原文

Translations API

BepInEx mod for ULTRAKILL that lets other mods register word/string

replacement pairs, applied to every bit of text the game renders through

TextMeshPro (HUD, menus, tooltips, subtitles, the cheat menu, etc.).

It ONLY Works on TextMeshPros.

  • GUID: com.nico.translationsapi
  • Depends on: BepInEx, HarmonyX (standard ULTRAKILL modding stack)

How it works

Every registered (source, replacement) pair is matched as a substring,

anywhere it appears in the text — not whole-word. Replacements are applied

in the order they were registered, so a later rule can end up matching text

produced by an earlier rule.

"gun" -> "pew pew" // "shotgun" becomes "shotpew pew"

"a" -> "AHHH" // every lowercase 'a' becomes "AHHH"

" " -> "" // strips every space

If two mods register the same source string, the most recently registered

one wins, and a warning is logged to the console so conflicts are easy to

spot.

Usage (for mod authors)

Add a reference to TranslationsAPI.dll, and in your plugin's BepInDependency:

[BepInDependency("com.nico.translationsapi")]

Then register your replacements, typically in Awake():

using TranslationsAPI;

TranslationRegistry.RegisterTranslation("gun", "pew pew");

TranslationRegistry.RegisterTranslation("a", "AHHH");

TranslationRegistry.RegisterTranslation(" ", "");

To remove a registered translation:

TranslationRegistry.UnregisterTranslation("gun");

API reference

| Method | Description |

|---|---|

| RegisterTranslation(string source, string replacement) | Registers a replacement. Ignored (with a warning) if source is null/empty. Overwrites an existing registration for the same source (last wins), logging a warning. |

| UnregisterTranslation(string source) | Removes a previously registered translation. No-op if it wasn't registered. |

Known limitations

  • Only text set through TMP_Text.text is caught. If some UI element in

ULTRAKILL doesn't go through TextMeshPro, it won't be affected.

  • Substring matching means short/common sources (like "a" or " ") will

match very aggressively — that's by design, but worth knowing before you

register something too broad.

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPack

檔案與校驗

檔案名稱
TranslationAPI-0.1.0.zip
檔案大小
8.3 KiB
SHA-256
bbdf7fd24e919217939714025267879d13ad381a5363b04417fc21ebd29f2dd5
入庫時間
2026-10-10 00:04