public class LanguageUtils extends Object
Modifier and Type | Field and Description |
---|---|
static LinkedHashMap<String,Locale> |
KEY_TO_COUNTRY_LOCALE_MAP |
static LinkedHashMap<String,Locale> |
KEY_TO_LOCALE_MAP |
Modifier and Type | Method and Description |
---|---|
static boolean |
doesStringEndWithLanguage(String string,
String language)
checks whether the given string matches or ends with the given language
|
static String |
getEnglishLanguageNameFromLocalizedString(String text)
uses our localized language mapping table, to get the english language name
|
static String |
getIso2LanguageFromLocalizedString(String text)
uses our localized language mapping table, to get the iso2 code
|
static String |
getISO3BLanguage(Locale locale)
Get the ISO 639-2/B 3 letter code
|
static String |
getISO3BLanguage(String language)
Get the ISO 639-2/B 3 letter code
|
static String |
getIso3BLanguageFromLocalizedString(String text)
uses our localized language mapping table, to get the iso3B code
|
static String |
getIso3LanguageFromLocalizedString(String text)
uses our localized language mapping table, to get the iso3 code
|
static String |
getLocalizedCountry(String... countries)
tries to get local (JVM language) COUNTRY name for given parameters/variants
|
static String |
getLocalizedCountryForLanguage(Locale language,
String... countries)
tries to get localized COUNTRY name (in given language) for given parameters/variants
|
static String |
getLocalizedCountryForLanguage(String language,
String... countries)
tries to get localized COUNTRY name (in given language) for given parameters/variants
|
static String |
getLocalizedLanguageNameFromLocalizedString(Locale language,
String... text)
uses our localized language mapping table, to get the localized language name in given language
|
static String |
getLocalizedLanguageNameFromLocalizedString(String text)
uses our localized language mapping table, to get the localized language name
|
public static final LinkedHashMap<String,Locale> KEY_TO_LOCALE_MAP
public static final LinkedHashMap<String,Locale> KEY_TO_COUNTRY_LOCALE_MAP
public static String getISO3BLanguage(Locale locale)
locale
- the locale to get the code forpublic static String getISO3BLanguage(String language)
language
- the 2 letter ISO code to get the 3 letter code forpublic static String getIso3LanguageFromLocalizedString(String text)
text
- the language (as string) to get the iso3 code forpublic static String getIso3BLanguageFromLocalizedString(String text)
text
- the language (as string) to get the iso3B code forpublic static String getIso2LanguageFromLocalizedString(String text)
text
- the language (as string) to get the iso2 code forpublic static String getEnglishLanguageNameFromLocalizedString(String text)
text
- the language (as string) to get the language name forpublic static String getLocalizedLanguageNameFromLocalizedString(String text)
text
- the language (as string) to get the language name forpublic static String getLocalizedLanguageNameFromLocalizedString(Locale language, String... text)
language
- the locale to which we translate the language (as string) to get the language name fortext
- the language (as string) to get the language name forpublic static String getLocalizedCountry(String... countries)
countries
- all possible names or iso codespublic static String getLocalizedCountryForLanguage(String language, String... countries)
countries
- all possible names or iso codespublic static String getLocalizedCountryForLanguage(Locale language, String... countries)
countries
- all possible names or iso codesCopyright © 2012–2019 tinyMediaManager. All rights reserved.