Universal Translation Framework
[b]Universal Translation Framework[/b]
A runtime string translation framework for RimWorld mods that enables dynamic replacement of hardcoded strings through IL code transpilation.
[b]Use Cases[/b]
[list]
[*] Mods with hardcoded strings and no translation interface
[/list]
[b]Usage[/b]
[list]
[*] Subscribe to this framework
[*] Create XML files containing "StringTranslation" in the target mod's Patches directory
[*] Restart the game to apply translations
[/list]
[b]Configuration Format[/b]
<?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>
[b]Target Identification[/b]
Use [url=https://steamcommunity.com/linkfilter/?u=https%3A%2F%2Fgithub.com%2FdnSpyEx%2FdnSpy]dnSpy[/url][github.com] decompiler to analyze mod DLL files and locate the classes and methods that need translation.
[b]Technical Implementation[/b]
Based on Harmony IL code transpilation for runtime dynamic string constant replacement.
Documentation: [url=https://steamcommunity.com/linkfilter/?u=https%3A%2F%2Fgithub.com%2FOcean456%2FUniversalTranslationFramework]GitHub Repository[/url][github.com]