Localize one visible label first, then add languages after the English key and lookup work. Rain World loads mod short strings from a language-specific strings.txt file. This recipe uses Remix labels, but the same keys can be passed to global::InGameTranslator.Translate(System.String) elsewhere.

Choose a namespaced key that describes the text’s purpose, not the English sentence. For a mod whose ID is myexample.dash, use myexample.dash_enable rather than enable or Enable dash. Keep the key stable when translators revise the display text.

Create the English file at this exact package path:

text/text_eng/strings.txt

Save it as UTF-8 and start it with 0. Separate lines with CRLF line endings. A complete first file is:

0
myexample.dash_enable|Enable dash
myexample.dash_duration|Dash duration

global::InGameTranslator.LoadShortStrings() removes the initial 0 and splits the remaining text on \r\n. It stores the segment after the first |. An LF-only file therefore needs correction even if it looks normal in an editor. Keep a literal pipe and /// out of translations. The parser treats /// as comment text, then splits at the first slash.

Use the key while building a Remix page:

new OpLabel(65f, 462f, Translate("myexample.dash_enable"));

OptionInterface.Translate delegates to the game’s translator. Use it for labels and descriptions that players read. Do not translate a config.Bind key such as dashEnabled, because that key identifies saved configuration data. Configurable ability shows both values in one settings page.

Add another language only after the English result appears. Use its Rain World language short name in the folder name, then provide the keys that have translations:

text/text_fre/strings.txt

The English pass runs only when Rain World’s base text/text_eng/strings.txt exists. For a non-English current language, its pass runs only when that base game’s corresponding language file exists. A mod file alone does not start either pass. When both base files exist, the loader reads English first, then current-language mod values replace English values. An omitted key keeps the English value. This lets a partial translation ship without hiding unconverted labels.

Check a packaged copy rather than the authoring file. Choose a game language whose base strings.txt exists, close and reopen the target menu, and confirm one translated key plus one deliberately omitted key. The expected result is translated text for the former and English text for the latter. Return to English and check that no key name is displayed. If a key name appears, verify the prefix, file path, 0 header, UTF-8 encoding, and CRLF bytes before changing code.

If the translation works in a menu but not an existing HUD or another retained object, determine when that object builds its text. Some controls need recreation or a language-change response before they ask the translator again. <LINE> is stored by the short-string loader and needs support from the UI helper that renders it, so check the chosen text component before using it for line breaks.

Localized text documents the loader rules and current-language conditions. Mod manifests covers the package identity used in namespaced keys.

Sources

  • Rain World v1.11.8, Steam build 22785462: global::InGameTranslator.LoadShortStrings(), global::InGameTranslator.Translate(System.String), global::InGameTranslator.TryTranslate(System.String,out System.String), and global::OptionInterface.Translate(System.String) in the assembly identified by Runtime reference.
  • Localized text