This tutorial covers the setup of localization files for your mods, which will enable you to move all your text out of your SBC definitions. This is good practice but more importantly also allows you to include translations of your mod within the mod itself - without a need to create and maintain a second mod.
- An editor capable of correctly displaying RESX files - for example Visual Studio Community 2019
- SISK's LoadLocalization script
- Empty MyTexts.resx file
Download SISK's LoadLocalization script and the empty MyTexts.resx
file. Place them as follows:
[YOURMOD]\Data\Scripts\SISK\LoadLocalization.cs
[YOURMOD]\Data\Localization\MyTexts.resx
The script will automatically load all localization files (== RESX files) present in the Localization
-folder of your mod.
Next, open MyTexts.resx
and you should see something like this:
Within your SBCs, place any string into the field you'd like to show text in, then add that same string to the Name
-column in the MyTexts.resx
-file. Place the text you want to show ingame into the Value
-column. This is pretty much it.
In order to include translations in your mod, simply include correctly named MyTexts
-files for the respective language in your mod:
Ensure that the Name
-column always stays the same, but replace the strings within the Value
-column with the translation of the string in the respective language. When a player selects a certain language ingame, the correct translations should immediately be used.