Localization
How to add localization texts to your mod.
How to install the required applications.
Completed setting up a modding environment for SBC modding.
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 version of the mod.
The alternative is to use SISK's script to load the .resx (remove the .sbl file if you use the script)
Setup
Download the MyTexts.resx and MyTexts.sbl files (top-right download icon) and place them as follows:
[YOURMOD]\Data\Localization\MyTexts.resx
[YOURMOD]\Data\Localization\MyTexts.sbl
DisplayName or Description-tags, you can now place any string as a variable (preceded by DisplayName_ or Description_ respectively) to connect it to a text bit saved within the RESX-file. This is done by wrapping the string into {LOC: and }:<DisplayName>{LOC:DisplayName_MyCoolString}</DisplayName>
<Description>{LOC:Description_MyCoolString}</Description>
New Resource and 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:DisplayName_MyCoolString | My Block Name
Description_MyCoolString | My Block Description
{LOC: ... }-wrap around the RESX reference. Only mods do.Translations
In order to include translations in your mod, add MyTexts. followed by the language code and then by the .resx extension.
MyTexts.resx is the default loaded for all languages, then the specific suffixed one is loaded for that language to override the entries in it. Since the default should be english, there's no point in doing MyTexts.en.resx too.
For example, if you want to add translations for Icelandic, create MyTexts.is-IS.resx.
- Code - Visual name (Internal name)
en- English (English)cs-CZ- Česky (Czech)sk-SK- Slovenčina (Slovak)de- Deutsch (German)ru- Русский (Russian)es- Español (España) (Spanish_Spain)fr- Français (French)it- Italiano (Italian)da- Dansk (Danish)nl- Nederlands (Dutch)is-IS- Íslenska (Icelandic)pl-PL- Polski (Polish)fi- Suomi (Finnish)hu-HU- Magyar (Hungarian)pt-BR- Português (Brasileiro) (Portuguese_Brazil)et-EE- Eesti (Estonian)no- Norsk (Norwegian)es-419- Español (Latinoamerica) (Spanish_HispanicAmerica)sv- Svenska (Swedish)ca-AD- Català (Catalan)hr-HR- Hrvatski (Croatian)ro- Română (Romanian)uk- Українська (Ukrainian)tr-TR- Türkçe (Turkish)lv- Latviešu (Latvian)zh-CN- Chinese (ChineseChina)
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.