public class LocaleResolver extends Object
LocaleResolver helps to resolve locale objects and languages.| Constructor and Description |
|---|
LocaleResolver() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isISOCountryCode(String code)
Checks the given code if its a valide ISO 3166-1 countrycode.
|
static Set<String> |
resolveAvailableLanguages(String bundlepackage,
String bundlename)
Resolves all the available languages for the given resource bundle name in the given bundle
package.
|
static String |
resolveBundlename(File propertiesFile)
Resolves the bundle name from the given properties file.
|
static Locale |
resolveLocale(File propertiesFile)
Resolves the locale from the given properties file.
|
static Locale |
resolveLocale(String localeCode)
Resolves the
Locale object from the given locale code. |
static String |
resolveLocaleCode(File propertiesFile)
Resolves from the given properties file the locale code like "en", "en_US" or "en_US_win".
|
static Locale |
resolveLocaleCode(String code)
Converts the given
String code like "en", "en_US" or "en_US_win" to new
Locale. |
static Map<File,Locale> |
resolveLocales(String bundlepackage,
String bundlename)
Resolves all the available Locales to the given resource bundle name in the given bundle
package.
|
public static boolean isISOCountryCode(String code)
code - The code to check.public static Set<String> resolveAvailableLanguages(String bundlepackage, String bundlename)
bundlepackage - The package that contains the properties files.bundlename - The name of the resource bundle.public static String resolveBundlename(File propertiesFile)
propertiesFile - the properties filepublic static Locale resolveLocale(File propertiesFile)
propertiesFile - the properties filepublic static Locale resolveLocale(String localeCode)
Locale object from the given locale code.localeCode - the locale codeLocale object.public static String resolveLocaleCode(File propertiesFile)
propertiesFile - the properties filepublic static Locale resolveLocaleCode(String code)
String code like "en", "en_US" or "en_US_win" to new
Locale.code - the codeLocale object or null.public static Map<File,Locale> resolveLocales(String bundlepackage, String bundlename)
bundlepackage - The package that contains the properties files.bundlename - The name of the resource bundle.Copyright © 2015 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.