Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

UDBase.Controllers.LocalizationSystem

konh edited this page Apr 25, 2018 · 3 revisions

ILocaleParser

Localization source parser

publicinterfaceUDBase.Controllers.LocalizationSystem.ILocaleParser

Methods

TypeNameSummary
StringGetValue(SystemLanguage language, String key)Return text for given languange and key
BooleanHasLanguage(SystemLanguage language)Is requested language presented in source?

ILocalization

Localization system to detect and store current language and translate text for it

publicinterfaceUDBase.Controllers.LocalizationSystem.ILocalization

Properties

TypeNameSummary
SystemLanguageCurrentLanguageCurrent user language

Methods

TypeNameSummary
StringTranslate(String key)Get text for given key and current language
StringTranslateFormat(String key, String[] args)Get text for given key and current language, then use string.Format with given args on it

LanguageChanged

Event which fired when language was changed

publicstructUDBase.Controllers.LocalizationSystem.LanguageChanged

Properties

TypeNameSummary
SystemLanguageNewLanguage

Methods

TypeNameSummary
StringToString()

Localization

Default localization controller

publicclassUDBase.Controllers.LocalizationSystem.Localization
:ILocalization

Properties

TypeNameSummary
SystemLanguageCurrentLanguage

Methods

TypeNameSummary
SystemLanguageDetectLanguage()Detect language at first time
StringTranslate(String key)
StringTranslateFormat(String key, String[] args)

LocalizationSaveNode

Save node for store current language with ISave

publicclassUDBase.Controllers.LocalizationSystem.LocalizationSaveNode
:ISaveSource

Properties

TypeNameSummary
SystemLanguageCurrentLanguage

SaveLocalization

Localization controller which uses ISave to store current language

publicclassUDBase.Controllers.LocalizationSystem.SaveLocalization
:ILocalization

Properties

TypeNameSummary
SystemLanguageCurrentLanguage

Methods

TypeNameSummary
SystemLanguageDetectLanguage()Detects current language at first time
StringTranslate(String key)
StringTranslateFormat(String key, String[] args)

SingleLocaleParser

Localization source which uses CSV file in format: first line header: ignored; language_name_0; ...; language_name_N; (language_name = UnityEngine.SystemLanguage name) next lines: key; value_for_language_0; ...; value_for_language_N;

publicclassUDBase.Controllers.LocalizationSystem.SingleLocaleParser
:ILocaleParser, ILogContext

Methods

TypeNameSummary
StringGetValue(SystemLanguage language, String key)
BooleanHasLanguage(SystemLanguage language)

Clone this wiki locally