Universal Translation Framework
A runtime string translation framework for RimWorld mods that enables dynamic replacement of hardcoded strings through IL code transpilation.
Use Cases
- Mods with hardcoded strings and no translation interface
Usage
- Subscribe to this framework
- Create XML files containing "StringTranslation" in the target mod's Patches directory
- Restart the game to apply translations
Configuration Format
<?xml version="1.0" encoding="utf-8"?>
<Patch>
<Operation Class="UniversalTranslationFramework.PatchOperationStringTranslate">
<targetType>TargetClassName</targetType>
<targetMethod>TargetMethodName</targetMethod>
<replacements>
<li><find>Original text</find><replace>Translated text</replace></li>
</replacements>
</Operation>
</Patch>
Target Identification
Use dnSpy[github.com] decompiler to analyze mod DLL files and locate the classes and methods that need translation.
Technical Implementation
Based on Harmony IL code transpilation for runtime dynamic string constant replacement.
Documentation: GitHub Repository[github.com]