This repository has been archived by the owner on Mar 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
UDBase.Controllers.LocalizationSystem
konh edited this page Apr 25, 2018
·
3 revisions
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? |
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 |
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() |
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) |
Save node for store current language with ISave
public class UDBase.Controllers.LocalizationSystem.LocalizationSaveNode
: ISaveSource
Properties
Type | Name | Summary |
---|---|---|
SystemLanguage |
CurrentLanguage |
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) |
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) |