I18N
A Hollow Knight: Silksong mod that automatically loads localized text for other mods.
About this mod Author’s original text
Silksong.I18N
A Hollow Knight: Silksong mod that automatically loads localized text for other mods.
Translate a Mod (for Users)
To translate a mod, you need to find that mod's translations folder. The translations folder should
be in another folder with the mod's name in BepInEx/plugins. If the mod uses I18N, it will have a
languages, Languages, or LANGUAGES folder next to its.dll file. That folder should contain
one or more.json files named for the languages they define: en.json, fr.json, and so on. The
capitalization doesn't matter.
The allowed languages are: en.json (English), fr.json (French), de.json (German), zh.json
(Simplified Chinese), es.json (Spanish), ko.json (Korean), ja.json (Japanese), it.json
(Italian), pt.json (Brazillian Portugese), and ru.json (Russian). You cannot currently translate
a mod into a language that is not one of these unless another mod provides support.
To add your language to a mod, first you need to create your translation file. Copy one of the mod's.json language files (whichever has the most lines) and rename it to your language's two-letter
code. If you wanted to translate an English mod to Brazillian Portugese, you would copy the mod's
en.json file and rename it to pt.json.
Then, open the new translation file in your text editor (Notepad on Windows) and translate all of
the text after the colons (:) on each line of the file. Do not edit the text before the
colons (:)! The text before the colons is how the mod knows which line is which.
For example, in the following translation file:
{
"TRANSLATION_KEY": "Localized text!",
"CUSTOM_TOOL_NAME": "Super Cool Tool",
"CUSTOM_TOOL_DESC": "The name of this tool rhymes. How amusing.",
"SOME_DIALOGUE": "Hi! I’m an NPC…And I’m Hornet.Yay!"
}
You should edit Localized text!, Super Cool Tool, The name of this tool rhymes. How amusing.,
and Hi! I’m an NPC…And I’m Hornet.Yay! by replacing the text with its translation
into your language. You should not edit TRANSLATION_KEY, CUSTOM_TOOL_NAME,
CUSTOM_TOOL_DESC, SOME_DIALOGUE, or any of the colons (:), straight quotation marks ("),
commas at the ends of lines (,), or the curly brackets ({ and }).
To use your translation in-game, change the game's language (in the main menu) to your language.
Usage (for Mod Developers)
If your mod requires localized text to function, add this as a dependency by adding the following
attribute to your mod's BaseUnityPlugin class:
[BepInDependency("org.silksong-modding.i18n")]
Additionally, if you're going to publish your mod, you need to add this as a
dependency in your mod's manifest. To do that, add the following like to your.toml file after the [package.dependencies] definition:
silksong_modding-I18N = "1.0.2"
Alternatively, if you don't have a.toml file, you can add this as a dependency by
adding "silksong_modding-I18N-1.0.2" to the dependencies array in your
manifest.json file.
This mod does not need to be added to your project as a reference.
Set a Default Language
You should set a default language for your mod to use if the game's current language isn't supported
or is missing translations. The default language should be whichever language is the best supported
by your mod.
You can set your mod's default language directly from C# code by adding the
System.Resources.NeutralResourcesLanguage attribute to your mod's assembly. To set your mod's
default language to English, you could add the following attribute to your mod's source code:
[assembly: System.Resources.NeutralResourcesLanguage("EN")]
Anywhere in the C# code will work, but the recommended location is Properties/AssemblyInfo.cs.
Alternatively, you can define the NeutralLanguage property in your mod's project file. To set your
mod's default language to English, you could add the following to your project file:
EN
Format Strings and Default Language
In some cases, it may be desirable to define a language string of the f
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: