ShiftAtMidnightLocalizationAPI
Shift At Midnight Localization API is a simple API module that enables mods to support multiple languages.
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.
Shift At Midnight Localization API (English)
Shift At Midnight Localization API is a simple API module that enables mods to support multiple languages.
What This Mod Does
- Provides language support for compatible mods.
- Updates supported mod text after the game language changes.
For Players
This mod is an API/dependency. It does not add gameplay features by itself.
Install it if another mod lists Shift At Midnight Localization API as a requirement.
For Mod Authors
Reference ShiftAtMidnightLocalizationAPI.dll and add a hard BepInEx dependency:
using BepInEx;
using BepInEx.Unity.IL2CPP;
using ShiftAtMidnightLocalizationAPI.Api;
[BepInDependency(ShiftAtMidnightLocalizationAPI.PluginInfo.PLUGIN_GUID)]
public sealed class MyPlugin: BasePlugin
{
public override void Load()
{
var enabled = Config.Bind("General", "Enabled", true, I18n.Text("config.enabled"));
I18n.RegisterDescription(enabled, "config.enabled");
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 also works with generated r2modman and mod-manager folder names:
using System.IO;
using System.Reflection;
using BepInEx.Configuration;
using ShiftAtMidnightLocalizationAPI.Api;
internal static class I18n
{
private const string FileName = "MyMod.Localization.json";
private static readonly ModLocalizer Localizer = Load();
public static string Text(string key, params object args)
{
return Localizer.GetLocalizedText(key, args);
}
public static void RegisterDescription(ConfigEntryBase entry, string key)
{
Localizer.RegisterConfigDescription(entry, key);
}
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;
}
}
Single JSON file example:
{
"ENGLISH": {
"mod.name": "My Mod",
"config.enabled": "Enable this mod."
},
"SIMPLIFIED CHINESE": {
"mod.name": "My Mod",
"config.enabled": "Enable this module."
}
}
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
- Russian: RUSSIAN
- German: GERMAN
- Spanish: SPANISH
- Japanese: JAPANESE
- Simplified Chinese: SIMPLIFIED CHINESE
- Traditional Chinese: TRADITIONAL CHINESE
- Brazilian Portuguese: BR PORTUGESE
Compatibility
- Game version: 1.0.1.0723.2253+
Installation
- Download and install BepInEx be.785 Unity (IL2CPP) for Windows (x64) games.
- Extract the mod into the game's root folder. The archive already includes the BepInEx\plugins folder structure.
Bug Reports & Feature Suggestions
If you have any questions or feature suggestions, please submit them through GitHub Issues, contact me on Discord at iceboxcool, or email me at 764884112@qq.com or ibox2333@gmail.com.
If you enjoy my mods, buy me a coffee! / If you enjoy my mods, buy me a coffee!
Shift At Midnight Localization API (Chinese)
Shift At Midnight Localization API is a simple API module used to support multi-language mods.
Main functions
- Provides multi-language support for compatible mods.
- Updated text for supported mods after switching game language.
to players
This is an API/dependency mod and does not add gameplay content itself.
If other mods require the Shift At Midnight Localization API to be installed, please install it.
To the mod author
Reference ShiftAtMidnightLocalizationAPI.dll in the project and add BepInEx …
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: