APlusLocalizationUtil

Functions

Link copied to clipboard
fun getLocalizedName(localizedString: String, languageCode: String): String

Parses the given localized string and returns the text corresponding to the specified language. If the entry in the requested language does not exist, the method attempts to localize the string in English. If that fails too, the whole raw string is returned. An example of a valid localized string is "|en:hello|fi:terve|".

Link copied to clipboard
fun languageCodeToName(languageCode: String): String

Returns the language name corresponding to the given ISO 639-1 language code. Only a few common ones are supported, otherwise the given language code is returned.