Show / Hide Table of Contents

# Class Localization

Class handling localization.

##### Inheritance

System.Object
Localization

##### Inherited Members

System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()

###### Namespace: Dalamud

###### Assembly: Dalamud.dll

##### Syntax

    public class Localization

### Constructors

| Improve this Doc View Source

#### Localization(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 Source

#### ApplicableLangCodes

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 Source

#### ExportLocalizable()

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

##### Declaration

    public void ExportLocalizable()

| Improve this Doc View Source

#### 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.

| Improve this Doc View Source

#### SetupWithFallbacks()

Set up the UI language with "fallbacks"(original English text).

##### Declaration

    public void SetupWithFallbacks()

| Improve this Doc View Source

#### 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.

| Improve this Doc View Source

#### SetupWithUiCulture()

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

##### Declaration

    public void SetupWithUiCulture()

### Events

| Improve this Doc View Source

#### LocalizationChanged

Event that occurs when the language is changed.

##### Declaration

    public event Localization.LocalizationChangedDelegate LocalizationChanged

##### Event Type

Type | Description
--- | ---
Localization.LocalizationChangedDelegate |