SimpleSilksongLocalizer
A simple text replacement plugin/library
About this mod Author’s original text
Simple Silksong Localizer
This mod makes it (relatively) easy to replace text, add translatable text, and add entire new languages to the game.
Installation
- Download and install BepInExPack Silksong.
- Download this mod and place it in /plugins
Usage
Usage of this mod revolves around creating translation sheets.
A translation sheet is an XML document containing many key (used for lookup) and value (displayed to user) pairs formatted as such:
Value
World!
Adding localization directories
The mod automatically registers directories as localization directories if their path is
/plugins/*/SSL.Localization.
For example with a layout like this:
└── BepInEx
└── plugins
├── AmazingMod
│ └── SSL.Localization
│ └── EN
│ └── MainMenu
├── Mod
│ └── Sub
│ └── SSL.Localization
├── Mod1
├── MyMod
│ └── SSL.Localization
└── MyOtherMod
└── Nope
Only MyMod/SSL.Localization and AmazingMod/SSL.Localization are registered as localization directories.
Additional directories can be registered with code that calls
SimpleSilkongLocalizerPlugin.AddLocalizationDirectory(string localizationDirectory).
(This requires creating a C# project that uses this as a dependency)
Replacing game text
To replace text, you must create a sheet with an entry that has the same key.
The sheet must also be named to match the original sheet, but with a slight adjustment.
The game's original sheets are in files named _,
but this mod looks for files in the localization directory named.
Example: Replace the "Start Game" text on the main menu with "Don't Start Game" for English.
This text is usually kept in the EN_MainMenu sheet
/EN/MainMenu
Don't Start Game
Please note: ' is used to insert an apostrophe ', because it cannot be used directly for XML values, along with some other characters.
Adding new translatable text keys
- Create a new sheet somewhere in a localization directory (e.g. EN/Sheet1)
- Inside your localization directory, create LocalizationSettings.json,
- In LocalizationSettings.json set the CustomSheets key to an array of paths to sheets you'd like to add.
{
"CustomSheets": [
"Sheet1",
"subdirectory/mysheet"
]
}
Fallbacks
If you are not providing sheets for every available language
(default: DE, EN, ES, FR, IT, JA, KO, PT, RU, ZH),
and would like for text from another language to be displayed instead of
user-unfriendly sheet-key pair strings:
Set the Fallback key. This allows you to set which language to fallback on if text is missing,
as well as exclude certain languages from displaying text from the fallback language.
{
"CustomSheets": [
"Sheet1",
"subdirectory/mysheet"
],
"Fallback": {
"Language": "EN",
"Excluded":
}
}
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.
Install these first, or the mod will not work: