@Singleton public class LanguageManager extends Object implements LanguageManagerInterface
Constructor and Description |
---|
LanguageManager()
A basic constructor which will automatically load english and MessageBundle File.
|
Modifier and Type | Method and Description |
---|---|
Locale |
getCurrentLocale()
Get the current locale, loaded with loadLocale.
|
Locale |
getLocale() |
ResourceBundle |
getResourceBundle() |
String |
getString(String label)
Get the localized string corresponding to the label.
|
String |
getString(String label,
String... params)
Get the localized string corresponding to the label and format it with the parameters.
|
Locale |
loadLocale(String region,
String country)
Load the locale corresponding to the region and the country and store it in the object.
|
public LanguageManager()
public Locale loadLocale(String region, String country)
LanguageManagerInterface
loadLocale
in interface LanguageManagerInterface
region
- the locale's regioncountry
- the locale's countrypublic String getString(String label, String... params)
LanguageManagerInterface
getString
in interface LanguageManagerInterface
label
- the label to findparams
- the parameters used to format the localized stringpublic Locale getCurrentLocale()
LanguageManagerInterface
getCurrentLocale
in interface LanguageManagerInterface
public String getString(String label)
LanguageManagerInterface
getString
in interface LanguageManagerInterface
label
- the label to findpublic Locale getLocale()
public ResourceBundle getResourceBundle()
Copyright © 2016. All Rights Reserved.