RomesteadLocalizationAPI
Romestead Localization API is a small dependency mod for Romestead mod authors. It lets mods register localized text through JSON files or embedded C# strings, then reapplies those strings automatical
About this mod Machine translation
Note: This description is a bilingual version in Chinese and English. The Chinese content is located below the English content. \
Note: This description is bilingual. The Chinese section is provided below the English section.
Romestead Localization API (English)
Romestead Localization API is a small dependency mod for Romestead mod authors. It lets mods register localized text through JSON files or embedded C# strings, then reapplies those strings automatically when the game loads or changes language.
Main Features
- Supports one JSON file for all languages: locale -> key -> text
- Supports multiple JSON files, one language per file
- Supports embedded C# registration for small mods that do not want to ship JSON files
- Automatically scopes keys by the registering mod GUID, so short keys like mod.name and entry.enabled do not conflict between mods
- Provides a bound localizer object, so mod code can use I18n.L.Text("mod.name") instead of passing the GUID every time
- Reapplies registered strings after the game reloads localization data
- Falls back to English, then Simplified Chinese, then the first available text when the current language is missing
For Players
This mod is an API/dependency. It does not add gameplay features by itself.
Install it if another mod lists Romestead Localization API as a requirement.
For Mod Authors
Add a hard dependency and reference RomesteadLocalizationAPI.dll from your project.
using BepInEx;
using BepInEx.NET.Common;
[BepInDependency(RomesteadLocalizationAPI.PluginInfo.PLUGIN_GUID)]
public sealed class MyPlugin: BasePlugin
{
public override void Load()
{
I18n.L.RegisterJson(Path.Combine(Paths.PluginPath, "MyMod", "Localization.json"));
}
}
Create a tiny bound localizer class:
using RomesteadLocalizationAPI.Api;
namespace MyMod;
internal static class I18n
{
public static readonly RomesteadLocalizer L =
RomesteadLocalization.For(PluginInfo.PLUGIN_GUID);
}
Single JSON file example:
{
"en": {
"mod.name": "My Mod",
"config.enabled.description": "Master switch for this mod."
},
"zh_CN": {
"mod.name": "My Mod",
"config.enabled.description": "The main switch for this module."
}
}
Use text in code:
var name = I18n.L.Text("mod.name");
var count = I18n.L.Text("items.count", itemCount);
Embedded text example:
I18n.L.RegisterTexts(
(RomesteadLocales.English, "mod.name", "My Mod"),
(RomesteadLocales.ChineseSimplified, "mod.name", "My Mod"));
A standalone HTML usage guide is included in the download as usage-guide.html.
Supported Locale Codes
- English: en
- Simplified Chinese: zh_CN
- Traditional Chinese: zh_TW
- Czech: cs_CZ
- German: de_DE
- Greek: el_GR
- Spanish: es_ES
- French: fr_FR
- Italian: it_IT
- Japanese: ja_JP
- Korean: ko_KR
- Dutch: nl_NL
- Polish: pl_PL
- Portuguese (Brazil): pt_BR
- Portuguese (Portugal): pt_PT
- Russian: ru_RU
- Slovak: sk_SK
- Swedish: sv_SE
- Thai: th_TH
- Turkish: tr_TR
- Ukrainian: uk_UA
Compatibility
- Game version: 0.25.1_10+
Bug Reports & Feature Suggestions
If you have any questions or feature suggestions, please submit them through GitHub Issues, or contact me directly at 764884112@qq.com or ibox2333@gmail.com.
Romestead Localization API (Chinese)
The Romestead Localization API is a small dependency module for use by Romestead modders. It allows mods to register localized text via a JSON file or C# inline string, and automatically reapply the text after the game loads or switches languages.
Main functions
- Supports single JSON file management for all languages: language -> key -> text
- Supports multiple JSON files, each file corresponds to one language
- Supports C# embedded text registration, suitable for small modules that do not want to carry additional JSON
- Automatically isolate keys by module GUID when registering, so short keys such as mod.name and entry.enabled will not conflict between different modules
- Provide the bound localizer object, the module code can be written I18n.L.Text("mod.name"), there is no need to pass the GU …
Install & use Install: follow the bundled instructions
- Unzip the archive from playbuff and read the bundled readme / instructions first.
- Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
- For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
- Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.
Install locations vary a lot between mods — the bundled readme is the most reliable guide.
Install these first, or the mod will not work: