Interface ILocalizationService
Localization service returns strings based on language keys.
Namespace: Simplic.Localization
Assembly: Simplic.Localization.dll
Syntax
public interface ILocalizationService
Properties
| Improve this Doc View SourceCurrentLanguage
Gets the current language
Declaration
CultureInfo CurrentLanguage { get; }
Property Value
Type | Description |
---|---|
System.Globalization.CultureInfo | System.Globalization.CultureInfo Current language |
Methods
| Improve this Doc View SourceChangeLanguage(CultureInfo)
Changes the current language
Declaration
void ChangeLanguage(CultureInfo language)
Parameters
Type | Name | Description |
---|---|---|
System.Globalization.CultureInfo | language | Language to change |
GetAvailableLanguages()
Returns a list of available languages
Declaration
IList<CultureInfo> GetAvailableLanguages()
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<System.Globalization.CultureInfo> | a list of available languages |
LoadDatabaseLocalization()
Load localization from the database
Declaration
void LoadDatabaseLocalization()
Search(String)
Searches the key list and returns the matching keys
Declaration
IDictionary<string, string> Search(string searchKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | searchKey | Search text |
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, System.String> | Result |
Translate(String)
Translates a key to a language
Declaration
string Translate(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Key to translate |
Returns
Type | Description |
---|---|
System.String | Translated text |
Translate(String, String[])
Translates a key formatted to a language
Declaration
string Translate(string key, params string[] formatValues)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Key to translate |
System.String[] | formatValues | Values to put in the string interpolation |
Returns
Type | Description |
---|---|
System.String | Translated formatted text |