UiDesc attributes are responsible for displaying the name and description of an item in the UI of the game:
There are two ways to set them.
If you want to keep it simple, you can just specify your text as a value of the appropriate XML attribute.
WARNING: The following special symbols are prohibited in this text: square brackets ("[","]") and a vertical bar ("|").
The usage of these symbols in the localization strings can lead to various issues (missing images in the same UI element, and so on).
For example, you can specify the name and description of your truck in the
UiDesc attributes of the
<UiDesc> tag, in double quotes:
However, if you specify the
UiDesc attributes this way, you will not be able to localize them. In all languages, they will appear just as you specified them.
If you want your text fields to support different languages, you need a little bit more effort.
In general, the process is the following:
- Instead of specifying text in your
UiDescattributes, you specify UI placeholders there.
These UI placeholders will be the identifiers of your localization strings.
For example, if you can specify
UI_MY_TRUCK_DESCas these identifiers:
<UiDesc UiDesc="UI_MY_TRUCK_DESC" UiIcon30x30="scoutVehicleImg30" UiIcon328x458="" UiIcon40x40="scoutVehicleImg" UiIconLogo="" UiName="UI_MY_TRUCK_NAME" />
- You create the folder named "texts" inside the folder of your mod (named "spider" in the screenshot below):
- In the texts folder, you need to create .str files corresponding to languages that you want to support. You can create them simply as empty .txt files, and then change their filename extension to .str. These files should match the list of languages supported by the game and should be named as specified below:
- In these .str files, you need to specify localization strings corresponding to your identifiers from step #1 above. You should do it in the same format, as in the original game: with the value next to the identifier, the value in quotation marks, and a new line as a delimiter. We recommend you to use "tab" symbols as a delimiter between the identifier and its value.
UI_MY_TRUCK_DESC "The best vehicle ever made!" UI_MY_TRUCK_NAME "Tin Lizzie"
WARNING #1: The following special symbols are prohibited in the localization strings: square brackets ("[","]") and a vertical bar ("|").
The usage of these symbols can lead to various issues (missing images in the same UI element, and so on).
WARNING #2: If you have not created a .str file for some language, the localization identifier will be displayed for this language (e.g. you will see "
UI_MY_TRUCK_NAME" in the UI).
WARNING #3: If you have not specified a value for your identifier (e.g. you specified "" as the value) for some language, the name of the localization identifier itself will be displayed for this language (e.g. you will see "
UI_MY_TRUCK_NAME" in the UI).
NOTE: You can use one of the .str files from the Mod Templates for trucks as a sample. They can be found in the folder where your game is installed, at the following path: ...\SnowRunner\en_us\Media\Mod Templates\mod_scout\texts. (Typically, the full path to this folder is similar to C:\Program Files\Epic Games\SnowRunner\en_us\Media\Mod Templates\mod_scout\texts.)
- Save your localization .str files in the "Little-endian UTF-16 Unicode" encoding.
WARNING: If the encoding of your files is different, the localization may not work!
In the game, values from .str files will be used instead of UI_identifiers.