Interface ILocalizationService
Namespace: IdleKit.Localization
Assembly: cs.temp.dll.dll
Syntax
public interface ILocalizationService : IService
Properties
CurrentLocale
Returns the currently loaded locale
Declaration
string CurrentLocale { get; }
Property Value
Type | Description |
---|---|
String |
Methods
GetLocalizedText(String, String)
Returns the translation text for a given key
Declaration
string GetLocalizedText(string key, string defaultText = "")
Parameters
Type | Name | Description |
---|---|---|
String | key | Lookup word for translation |
String | defaultText | Fallback string if key is not found. |
Returns
Type | Description |
---|---|
String | Translation text |
SetLocale(String, Action)
Changes the current locale
Declaration
bool SetLocale(string locale, Action onComplete = null)
Parameters
Type | Name | Description |
---|---|---|
String | locale | The language key |
Action | onComplete | Broadcast when the language loading is complete |
Returns
Type | Description |
---|---|
Boolean | True when the language can be loaded |