SimpleSilksongLocalizer
A simple text replacement plugin/library
模組介紹 作者原文
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":
}
}
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: