Loading...
Searching...
No Matches
PixelCrushers.UILocalizationManager Class Reference

Manages localization settings. More...

Inheritance diagram for PixelCrushers.UILocalizationManager:
Collaboration diagram for PixelCrushers.UILocalizationManager:

Public Member Functions

void Initialize ()
 
bool HasLanguage (string language)
 Checks if text table(s) support the specified language.
 
bool HasField (string fieldName)
 Checks if text table(s) have a specified field.
 
string GetFieldTextForLanguage (string fieldName, string language)
 Returns the localized text for a field in a specified language.
 
string GetLocalizedText (string fieldName)
 Returns the localized text for a field in the current language.
 
void UpdateUIs (string language)
 Updates the current language and all localized UIs.
 

Properties

LocalizedFonts localizedFonts [get, set]
 
static UILocalizationManager instance [get, set]
 Current global instance of UILocalizationManager.
 
TextTable textTable [get, set]
 Overrides the global text table.
 
List< TextTableadditionalTextTables [get, set]
 (Optional) Any additional text tables.
 
string currentLanguage [get, set]
 Gets or sets the current language.
 
string currentLanguagePlayerPrefsKey [get, set]
 The PlayerPrefs key to store the player's selected language code.
 
bool saveLanguageInPlayerPrefs [get, set]
 
bool useDefaultLanguageForBlankTranslations [get, set]
 

Events

static System.Action< string > languageChanged = null
 

Detailed Description

Manages localization settings.

Member Function Documentation

◆ GetFieldTextForLanguage()

string PixelCrushers.UILocalizationManager.GetFieldTextForLanguage ( string  fieldName,
string  language 
)
inline

Returns the localized text for a field in a specified language.

◆ GetLocalizedText()

string PixelCrushers.UILocalizationManager.GetLocalizedText ( string  fieldName)
inline

Returns the localized text for a field in the current language.

◆ HasField()

bool PixelCrushers.UILocalizationManager.HasField ( string  fieldName)
inline

Checks if text table(s) have a specified field.

Parameters
fieldName
Returns

◆ HasLanguage()

bool PixelCrushers.UILocalizationManager.HasLanguage ( string  language)
inline

Checks if text table(s) support the specified language.

◆ Initialize()

void PixelCrushers.UILocalizationManager.Initialize ( )
inline

◆ UpdateUIs()

void PixelCrushers.UILocalizationManager.UpdateUIs ( string  language)
inline

Updates the current language and all localized UIs.

Parameters
languageLanguage code defined in your Text Table.

Property Documentation

◆ additionalTextTables

List<TextTable> PixelCrushers.UILocalizationManager.additionalTextTables
getset

(Optional) Any additional text tables.

◆ currentLanguage

string PixelCrushers.UILocalizationManager.currentLanguage
getset

Gets or sets the current language.

Setting the current language also updates localized UIs.

◆ currentLanguagePlayerPrefsKey

string PixelCrushers.UILocalizationManager.currentLanguagePlayerPrefsKey
getset

The PlayerPrefs key to store the player's selected language code.

◆ instance

UILocalizationManager PixelCrushers.UILocalizationManager.instance
staticgetset

Current global instance of UILocalizationManager.

If one doesn't exist, a default one will be created.

◆ localizedFonts

LocalizedFonts PixelCrushers.UILocalizationManager.localizedFonts
getset

◆ saveLanguageInPlayerPrefs

bool PixelCrushers.UILocalizationManager.saveLanguageInPlayerPrefs
getset

◆ textTable

TextTable PixelCrushers.UILocalizationManager.textTable
getset

Overrides the global text table.

◆ useDefaultLanguageForBlankTranslations

bool PixelCrushers.UILocalizationManager.useDefaultLanguageForBlankTranslations
getset

Event Documentation

◆ languageChanged

System.Action<string> PixelCrushers.UILocalizationManager.languageChanged = null
static

The documentation for this class was generated from the following file: