public final class LocaleExtensions
extends java.lang.Object
| Constructor and Description |
|---|
LocaleExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
contains(java.util.Locale locale)
Checks if the given
Locale is in the available locales on the current jdk. |
static java.util.List<java.util.Locale> |
getAvailableLocales()
Deprecated.
use instead same name method in LocaleResolver class. Note: will be removed on
next minor release.
|
static java.lang.String |
getCountryName(java.lang.String countryCode,
java.util.Locale inLocale)
Gets the display country name from the given country code in the given
Locale. |
static java.lang.String |
getCountryName(java.lang.String countryCode,
java.util.Locale inLocale,
java.lang.String defaultCountryName)
Gets the display country name from the given country code from the given
Locale. |
static java.lang.String |
getLanguageName(java.lang.String languageCode,
java.util.Locale inLocale)
Gets the display language name from the given language code in the given
Locale. |
static java.lang.String |
getLocaleFilenameSuffix(java.util.Locale locale)
Gets the locale file name suffix that has the format 'language_COUNTRY_variant' for instance
'de_DE' for the Locale.GERMANY.
|
static java.lang.String |
getLocaleFileSuffix(java.util.Locale locale,
boolean withCountry)
Gets the locale file name suffix for instance '_de_DE' for the Locale.GERMANY.
|
static java.lang.String |
getLocaleFileSuffix(java.util.Locale locale,
boolean withCountry,
boolean withVariant)
Gets the locale file name suffix for instance '_de_DE' for the Locale.GERMANY.
|
static java.lang.String |
getLocaleFileSuffix(java.util.Locale locale,
boolean withCountry,
boolean withVariant,
boolean withUnderscorePrefix)
Gets the locale file name suffix for instance '_de_DE' for the Locale.GERMANY.
|
static java.lang.String |
getLocaleName(java.util.Locale locale)
Gets the locale name for instance 'de_DE' for the Locale.GERMANY.
|
public static java.lang.String getLocaleFilenameSuffix(java.util.Locale locale)
locale - the localepublic static java.lang.String getLocaleFileSuffix(java.util.Locale locale,
boolean withCountry)
locale - the localewithCountry - the with countrypublic static java.lang.String getLocaleFileSuffix(java.util.Locale locale,
boolean withCountry,
boolean withVariant)
locale - the localewithCountry - with countrywithVariant - with variantpublic static java.lang.String getLocaleFileSuffix(java.util.Locale locale,
boolean withCountry,
boolean withVariant,
boolean withUnderscorePrefix)
locale - the localewithCountry - with countrywithVariant - with variantwithUnderscorePrefix - true if the result has to have the underscore prefixpublic static java.lang.String getLocaleName(java.util.Locale locale)
locale - the localepublic static boolean contains(java.util.Locale locale)
Locale is in the available locales on the current jdk.locale - the locale to check@Deprecated public static java.util.List<java.util.Locale> getAvailableLocales()
public static java.lang.String getCountryName(java.lang.String countryCode,
java.util.Locale inLocale)
Locale.countryCode - the country codeinLocale - The locale for which to retrieve the display countrypublic static java.lang.String getCountryName(java.lang.String countryCode,
java.util.Locale inLocale,
java.lang.String defaultCountryName)
Locale. If
not found the given default country name is returned.countryCode - the country codeinLocale - The locale for which to retrieve the display countrydefaultCountryName - the default country namepublic static java.lang.String getLanguageName(java.lang.String languageCode,
java.util.Locale inLocale)
Locale.languageCode - the language codeinLocale - The locale for which to retrieve the display language