GK2LocalizationAPI

v1.0.1·Updated 2026-10-08

Graveyard Keeper 2 Localization API is a shared localization library for Graveyard Keeper 2 mods, making it easier for mod authors to add multilingual support to their 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.

Graveyard Keeper 2 Localization API (English)

Graveyard Keeper 2 Localization API is a shared localization library for Graveyard Keeper 2 mods, making it easier for mod authors to add multilingual support to their mods.

What This Mod Does

  • Lets compatible mods load their own external JSON language files.
  • Uses Graveyard Keeper 2'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 Graveyard Keeper 2 Localization API as a requirement.

For Mod Authors

Example mods for reference: Graveyard Keeper 2 example mods

Reference GraveyardKeeper2LocalizationAPI.dll and add a hard BepInEx dependency:

using BepInEx;

using BepInEx.Configuration;

using GraveyardKeeper2LocalizationAPI.Api;

[BepInDependency(GraveyardKeeper2LocalizationAPI.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 GraveyardKeeper2LocalizationAPI.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.name and.description. Enum and acceptable-list values use a normalized lowercase suffix, so SafeMode resolves to.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(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_cn": {

"config.general": "General",

"config.enabled.name": "Enabled",

"config.enabled.description": "Enable this mod.",

"config.mode.name": "mode",

"config.mode.description": "Select the running mode.",

"config.mode.safe_mode": "safe"

}

}

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_cn
  • French: fr
  • German: de
  • Portuguese (Brazil): pt-br
  • Japanese: ja
  • Korean: ko
  • Polish: pl
  • Russian: ru
  • Spanish: es
  • Turkish: tr

Compatibility

  • Game: Graveyard Keeper 2 (Unity Mono)

Bug Reports & Feature Suggestions

I …

Install & use Install: follow the bundled instructions

  1. Unzip the archive from playbuff and read the bundled readme / instructions first.
  2. 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.
  3. For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
  4. 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.

Dependencies

Install these first, or the mod will not work:

BepInEx-BepInExPack

File & checksum

Filename
GK2LocalizationAPI-1.0.1.zip
File size
171.4 KiB