Class LocalizationTool
Utilities for working with Kingmaker.Localization.LocalizedString.
Inheritance
Namespace: BlueprintCore.Utils
Assembly: BlueprintCore.dll
Syntax
public class LocalizationTool
Remarks
By default it assumes your mod's local strings are contained in the file LocalizedStrings.json in the same directory as the assembly. If you keep it in a different location you can call LoadLocalizationPack(String).
Methods
| Improve this Doc View SourceCreateString(String, String, Boolean)
Returns a localized string with the provided key
and value
.
Declaration
public static LocalizedString CreateString(string key, string value, bool tagEncyclopediaEntries = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | |
System.String | value | |
System.Boolean | tagEncyclopediaEntries |
Returns
Type | Description |
---|---|
Kingmaker.Localization.LocalizedString |
Remarks
Use of this method is discouraged. Prefer definining a localization pack. See TODO: LINK TO DOCS for more details.
Calls TagEncyclopediaEntries(String) on value
by default. Override
tagEncyclopediaEntries
if this is not desired.
GetString(String)
Returns the localized string matching the current key.
Declaration
public static LocalizedString GetString(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key |
Returns
Type | Description |
---|---|
Kingmaker.Localization.LocalizedString |
LoadEmbeddedLocalizationPacks(String[])
Loads localized strings from an array of embedded JSON files.
Declaration
public static void LoadEmbeddedLocalizationPacks(params string[] resourceNames)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | resourceNames | Array of resource names, each of which is a JSON file with an array of MultiLocaleString values |
Remarks
It is recommended to only use this or LoadLocalizationPack(String). Load performance is improved using this method. Using both will result in errors. By default all files ending in "Strings.json" in the assembly directory are loaded.
LoadLocalizationPack(String)
Loads localized strings from a JSON file.
Declaration
public static void LoadLocalizationPack(string localizedStringsFile)
Parameters
Type | Name | Description |
---|---|---|
System.String | localizedStringsFile | JSON file with an array of MultiLocaleString values |
LoadLocalizationPacks(String[])
Loads localized strings from an array of JSON files.
Declaration
public static void LoadLocalizationPacks(params string[] stringFiles)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | stringFiles | Array of file paths, each of which is a JSON file with an array of MultiLocaleString values |
Remarks
Use only this or LoadEmbeddedLocalizationPacks(String[]). Using both will result in errors. By default all files ending in "Strings.json" in the assembly directory are loaded.