Class Localization
Class handling localization.
Inheritance
Inherited Members
Namespace: Dalamud
Assembly: Dalamud.dll
Syntax
public class Localization
Constructors
| Improve this Doc View SourceLocalization(String, String, Boolean)
Initializes a new instance of the Localization class.
Declaration
public Localization(string locResourceDirectory, string locResourcePrefix = "", bool useEmbedded = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | locResourceDirectory | The working directory to load language files from. |
| System.String | locResourcePrefix | The prefix on the loc resource file name (e.g. dalamud_). |
| System.Boolean | useEmbedded | Use embedded loc resource files. |
Fields
| Improve this Doc View SourceApplicableLangCodes
Array of language codes which have a valid translation in Dalamud.
Declaration
public static readonly string[] ApplicableLangCodes
Field Value
| Type | Description |
|---|---|
| System.String[] |
Methods
| Improve this Doc View SourceExportLocalizable()
Saves localizable JSON data in the current working directory for the provided assembly.
Declaration
public void ExportLocalizable()
Localize(String, String)
Search the set-up localization data for the provided assembly for the given string key and return it. If the key is not present, the fallback is shown. The fallback is also required to create the string files to be localized.
Declaration
public static string Localize(string key, string fallBack)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | key | The string key to be returned. |
| System.String | fallBack | The fallback string, usually your source language. |
Returns
| Type | Description |
|---|---|
| System.String | The localized string, fallback or string key if not found. |
SetupWithFallbacks()
Set up the UI language with "fallbacks"(original English text).
Declaration
public void SetupWithFallbacks()
SetupWithLangCode(String)
Set up the UI language with the provided language code.
Declaration
public void SetupWithLangCode(string langCode)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | langCode | The language code to set up the UI language with. |
SetupWithUiCulture()
Set up the UI language with the users' local UI culture.
Declaration
public void SetupWithUiCulture()
Events
| Improve this Doc View SourceLocalizationChanged
Event that occurs when the language is changed.
Declaration
public event Localization.LocalizationChangedDelegate LocalizationChanged
Event Type
| Type | Description |
|---|---|
| Localization.LocalizationChangedDelegate |