Skip to content
This repository has been 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

public interface UDBase.Controllers.LocalizationSystem.ILocaleParser

Methods

Type Name Summary
String GetValue(SystemLanguage language, String key) Return text for given languange and key
Boolean HasLanguage(SystemLanguage language) Is requested language presented in source?

ILocalization

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

public interface UDBase.Controllers.LocalizationSystem.ILocalization

Properties

Type Name Summary
SystemLanguage CurrentLanguage Current user language

Methods

Type Name Summary
String Translate(String key) Get text for given key and current language
String TranslateFormat(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

public struct UDBase.Controllers.LocalizationSystem.LanguageChanged

Properties

Type Name Summary
SystemLanguage NewLanguage

Methods

Type Name Summary
String ToString()

Localization

Default localization controller

public class UDBase.Controllers.LocalizationSystem.Localization
    : ILocalization

Properties

Type Name Summary
SystemLanguage CurrentLanguage

Methods

Type Name Summary
SystemLanguage DetectLanguage() Detect language at first time
String Translate(String key)
String TranslateFormat(String key, String[] args)

LocalizationSaveNode

Save node for store current language with ISave

public class UDBase.Controllers.LocalizationSystem.LocalizationSaveNode
    : ISaveSource

Properties

Type Name Summary
SystemLanguage CurrentLanguage

SaveLocalization

Localization controller which uses ISave to store current language

public class UDBase.Controllers.LocalizationSystem.SaveLocalization
    : ILocalization

Properties

Type Name Summary
SystemLanguage CurrentLanguage

Methods

Type Name Summary
SystemLanguage DetectLanguage() Detects current language at first time
String Translate(String key)
String TranslateFormat(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;

public class UDBase.Controllers.LocalizationSystem.SingleLocaleParser
    : ILocaleParser, ILogContext

Methods

Type Name Summary
String GetValue(SystemLanguage language, String key)
Boolean HasLanguage(SystemLanguage language)