BigWalkLocalizationAPI
BigWalkLocalizationAPI is a shared localization API for Big Walk mods.
About this mod Machine translation
Note: This description is bilingual. The Chinese section is provided below the English section.
Note: This description is a bilingual version in Chinese and English. The Chinese content is located below the English content.
BigWalkLocalizationAPI (English)
BigWalkLocalizationAPI is a shared localization API for Big Walk mods.
What This Mod Does
- Loads external JSON localization files for individual mods.
- Uses Big Walk's active language and raises a language-change event for mod UI.
- Provides one-call localization for config sections, names, descriptions, and enum or list values.
For Players
This mod is an API/dependency. It does not add gameplay features by itself.
Install it only when another Big Walk mod lists BigWalkLocalizationAPI as a requirement.
For Mod Authors
Reference BigWalkLocalizationAPI.dll and add a hard dependency:
using System;
using System.IO;
using System.Reflection;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Unity.IL2CPP;
using BigWalkLocalizationAPI.Api;
[BepInPlugin(PluginInfo.PLUGIN_GUID, "My Mod", "1.0.0")]
[BepInDependency(BigWalkLocalizationAPI.PluginInfo.PLUGIN_GUID)]
public sealed class MyPlugin: BasePlugin
{
public override void Load()
{
string directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
ModLocalizer localizer = LocalizationApi.For(PluginInfo.PLUGIN_GUID);
localizer.RegisterJson(Path.Combine(directory, "MyMod.Localization.json"));
Config.Bind("General", "Enabled", true, I18n.Localizer.Config("config.enabled", 20, "General", "config.section.general", 10));
LocalizationApi.LanguageChanged += OnLanguageChanged;
}
private static void OnLanguageChanged(string language)
{
// Refresh this mod's existing UI text here.
}
}
Load the JSON file from the directory containing your mod DLL. This works with generated mod-manager folder names:
using System.IO;
using System.Reflection;
using BigWalkLocalizationAPI.Api;
internal static class I18n
{
private const string FileName = "MyMod.Localization.json";
private static readonly ModLocalizer _localizer = Load();
internal static ModLocalizer Localizer
{
get { return _localizer; }
}
internal static string Text(string key, params object args)
{
return _localizer.GetLocalizedText(key, args);
}
private static ModLocalizer Load()
{
string directory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
ModLocalizer localizer = LocalizationApi.For(PluginInfo.PLUGIN_GUID);
localizer.RegisterJson(Path.Combine(directory, FileName));
return localizer;
}
}
The Config call uses the config section and key to find localized names, descriptions, and enum or acceptable-list values. Values are normalized to lowercase snake_case suffixes. Numeric ranges can also pass an optional sliderStep for Mod Settings Menu:
Config.Bind("General", "Mode", MyMode.SafeMode, I18n.Localizer.Config("config.mode", 20, "General", "config.section.general", 10));
Config.Bind("General", "Speed", 1f, I18n.Localizer.Config("config.speed", 30, "General", "config.section.general", 10, new AcceptableValueRange(0.5f, 3f), sliderStep: 0.25d));
Single JSON file example:
{
"English": {
"config.section.general": "General",
"config.mode.name": "Mode",
"config.mode.description": "Select the operating mode.",
"config.mode.safe_mode": "Safe"
},
"SimplifiedChinese": {
"config.section.general": "General",
"config.mode.name": "mode",
"config.mode.description": "Select the running mode.",
"config.mode.safe_mode": "safe"
}
}
Every localization file must contain an English object. If the current language or requested key is missing, the API tries English; if the key is still missing, it returns the key itself.
Supported Language Names
- English: English
- French: French
- Italian: Italian
- German: German
- European Spanish: EuropeanSpanish
- Simplified Chinese: SimplifiedChinese
- Japanese: Japanese
- Russian: Russian
- Korean: Korean
- Brazilian Portuguese: BrazilianPortuguese
- Polish: Polish
- Turkish: Turkish …
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: