Source-checkedLibraries & compatibility

SunkenlandLocalizationAPI

by Ice_Box_Studio_Sunkenland · for Sunkenland

Sunkenland Localization API is a shared localization library for Sunkenland BepInEx mods.

373Downloads
3 mo agoLast updated
BepInExLoaders
ThunderstoreSource

About SunkenlandLocalizationAPI

From Thunderstore

Sunkenland Localization API is a shared localization library for Sunkenland BepInEx mods.

Note: This description is bilingual. The Chinese section is provided below the English section. 说明:本描述为中英双语版本,中文内容位于英文内容下方。


Sunkenland Localization API (English)

Sunkenland Localization API is a shared localization library for Sunkenland mods.

What This Mod Does

  • Lets compatible mods load their own external JSON language files.
  • Uses Sunkenland's active language and refreshes registered mod text after a language change.
  • Supports localized config sections, setting names, descriptions, dropdown values, ordering, and slider steps.

For Players

This mod is an API/dependency. It does not add gameplay features by itself. Install it only when another mod lists Sunkenland Localization API as a requirement.

For Mod Authors

Reference SunkenlandLocalizationAPI.dll and add a hard BepInEx dependency:

using BepInEx;
using BepInEx.Configuration;
using SunkenlandLocalizationAPI.Api;

[BepInDependency(SunkenlandLocalizationAPI.PluginInfo.PLUGIN_GUID)]
public sealed class MyPlugin : BaseUnityPlugin
{
    private void Awake()
    {
        Config.Bind("General", "Enabled", true, I18n.Localizer.Config("config.enabled", 10, "General", "config.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 also works with generated r2modman and mod-manager folder names:

using System.IO;
using System.Reflection;
using SunkenlandLocalizationAPI.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 <key>.name and <key>.description. Enum and acceptable-list values use a normalized lowercase suffix, so SafeMode resolves to <key>.safe_mode automatically:

Config.Bind("General", "Mode", MyMode.SafeMode, I18n.Localizer.Config("config.mode", 20, "General", "config.general", 10));

Pass an AcceptableValueRange and sliderStep to declare a custom range-slider step in the same call:

Config.Bind("Display", "Scale", 100, I18n.Localizer.Config("config.scale", 10, "Display", "config.display", 20, new AcceptableValueRange<int>(50, 200), sliderStep: 5d));

Single JSON file example:

{
  "en": {
    "config.general": "General",
    "config.enabled.name": "Enabled",
    "config.enabled.description": "Enable this mod.",
    "config.mode.name": "Mode",
    "config.mode.description": "Select the operating mode.",
    "config.mode.safe_mode": "Safe"
  },
  "zh-Hans": {
    "config.general": "常规",
    "config.enabled.name": "启用",
    "config.enabled.description": "启用此模组。",
    "config.mode.name": "模式",
    "config.mode.description": "选择运行模式。",
    "config.mode.safe_mode": "安全"
  }
}

Every localization file must contain an en object. If the current language or requested key is missing, the API tries en; if the key is still missing, it returns the key itself.

Supported Locale Codes

  • English: en
  • Chinese (Simplified): zh-Hans
  • French: fr
  • German: de
  • Japanese: ja
  • Korean: ko
  • Russian: ru
  • Spanish: es
  • Turkish: tr

Compatibility

  • Game version: Beta 0.8.41+

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, feel free to support me! / 如果你喜欢我的模组,请支持我一下吧!

Ko-fi &nbsp; 爱发电


Sunkenland Localization API (中文)

Sunkenland Localization API 是为 Sunkenland 模组提供的共享本地化库。

主要功能

  • 让兼容模组加载各自独立的外置 JSON 语言文件。
  • 读取 Sunkenland 当前语言,并在语言切换后刷新已注册的模组文本。
  • 支持配置分类、配置名称、说明、下拉选项值、排序和滑条步进。

给玩家

这是一个 API/依赖模组,本身不会添加玩法内容。 只有其他模组要求安装 Sunkenland Localization API 时才需要安装它。

给模组作者

在项目中引用 SunkenlandLocalizationAPI.dll,并添加 BepInEx 硬依赖:

using BepInEx;
using BepInEx.Configuration;
using SunkenlandLocalizationAPI.Api;

[BepInDependency(SunkenlandLocalizationAPI.PluginInfo.PLUGIN_GUID)]
public sealed class MyPlugin : BaseUnityPlugin
{
    private void Awake()
    {
        Config.Bind("General", "Enabled", true, I18n.Localizer.Config("config.enabled", 10, "General", "config.general", 10));
        LocalizationApi.LanguageChanged += OnLanguageChanged;
    }

    private static void OnLanguageChanged(string language)
    {
        // 在这里刷新模组已经创建的 UI 文本。
    }
}

从模组 DLL 自己所在的目录加载 JSON。这样即使 r2modman 或其他模组管理器生成了不同的插件文件夹名,也能正确找到语言文件:

using System.IO;
using System.Reflection;
using SunkenlandLocalizationAPI.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);
    }

Read the full description on Thunderstore →

Highlights

From source data

Loaders

Runs on BepInEx.

Footprint

Rated a light load on a server.

Dependencies

Needs 1 other project installed alongside it.

SunkenlandLocalizationAPI on Nxeon

From our catalogue
One-click install
Not available. One-click install isn't available for this game's mods yet. Download it and upload it to your server in Files.
Server type needed
BepInEx
Server load
light
Smallest plan we suggest
Sunkenland — 4 GB (4 GB RAM). This follows our own load rating above, not a benchmark.
Latest build
1.2.0, released 2026-08-16

Game versions by loader

LoaderGame versionsNewest
BepInEx

From 3 recorded builds of SunkenlandLocalizationAPI.

Recent builds

BuildReleasedGame versionsLoaders
1.2.02026-08-16n/aBepInEx
1.1.02026-08-13n/aBepInEx
1.0.02026-08-07n/aBepInEx

Dependencies

Declared by the newest build that lists any. Required ones are installed with it on one-click installs.

Run SunkenlandLocalizationAPI on a Sunkenland server

Deploy a server above, then upload the file in Files.

What kind of mod it is

From the catalog
Listed on Thunderstore as “Core”

Libraries & compatibility

Foundations and fixes other mods build on. Usually installed because something else needs it.

Compatibility

Game
Sunkenland
Loaders
BepInEx
Requires
One-click install needs a BepInEx server. 1 other project installed alongside it.

Verified at the source

  • ✓ThunderstoreOfficial listing, checked 2026-10-02Open ↗
  • ✓AuthorIce_Box_Studio_Sunkenland, as published on Thunderstore
  • ✓LicenseNot published by the sourceFree

SunkenlandLocalizationAPI, answered

Generated from the mod’s own source data.

Which loaders does it support?

BepInEx.

Is it free?

Yes. SunkenlandLocalizationAPI is free to download from Thunderstore.

How do I add it to my Nxeon server?

One-click install isn't available for this game's mods yet. Download SunkenlandLocalizationAPI from Thunderstore and upload it to your Nxeon Sunkenland server in Files.

NxLabs

Run SunkenlandLocalizationAPI on a Sunkenland server.

Deploy in about a minute from $8.99 a month, then upload SunkenlandLocalizationAPI in Files.