Show / Hide Table of Contents

Class LocalizationTool

Utilities for working with Kingmaker.Localization.LocalizedString.

Inheritance
System.Object
LocalizationTool
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 Source

CreateString(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.

| Improve this Doc View Source

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
| Improve this Doc View Source

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.

| Improve this Doc View Source

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

| Improve this Doc View Source

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.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX