Skip to main content
Version: 15.x (API 15) [Current]

Class Localization

Class handling localization.

Assembly: Dalamud.dll​
Declaration
public class Localization : IServiceType

Implements:
Dalamud.IServiceType

Properties​

DalamudLanguageCultureInfo​

Gets an instance of System.Globalization.CultureInfo that corresponds to the language configured from Dalamud Settings.

Declaration
public CultureInfo DalamudLanguageCultureInfo { get; }

Fields​

ApplicableLangCodes​

Array of language codes which have a valid translation in Dalamud.

Declaration
public static readonly string[] ApplicableLangCodes

Methods​

GetCultureInfoFromLangCode(string)​

Gets an instance of System.Globalization.CultureInfo that corresponds to a Dalamud <code class="paramref">langCode</code>.

Declaration
public static CultureInfo GetCultureInfoFromLangCode(string langCode)
Returns​

System.Globalization.CultureInfo: The corresponding instance of System.Globalization.CultureInfo.

Parameters​
TypeNameDescription
System.StringlangCodeThe language code which should be in Dalamud.Localization.ApplicableLangCodes.

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)
Returns​

System.String: The localized string, fallback or string key if not found.

Parameters​
TypeNameDescription
System.StringkeyThe string key to be returned.
System.StringfallBackThe fallback string, usually your source language.

SetupWithUiCulture()​

Set up the UI language with the users' local UI culture.

Declaration
public void SetupWithUiCulture()

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​
TypeNameDescription
System.StringlangCodeThe language code to set up the UI language with.

ExportLocalizable(bool)​

Saves localizable JSON data in the current working directory for the provided assembly.

Declaration
public void ExportLocalizable(bool ignoreInvalidFunctions = false)
Parameters​
TypeNameDescription
System.BooleanignoreInvalidFunctionsIf set to true, this ignores malformed Localize functions instead of failing.

Events​

LocalizationChanged​

Event that occurs when the language is changed.

Declaration
public event Localization.LocalizationChangedDelegate? LocalizationChanged
Event Type​

Dalamud.Localization.LocalizationChangedDelegate

Implements​