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.
com.nico.translationsapiEvery 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.
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");
| 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. |
TMP_Text.text is caught. If some UI element in
ULTRAKILL doesn't go through TextMeshPro, it won't be affected."a" or " ") will
match very aggressively — that's by design, but worth knowing before you
register something too broad.