public class LocalizationContext extends Object
An I18N localization context has two components: a resource bundle and the locale that led to the resource bundle match.
The resource bundle component is used by <fmt:message> for mapping message keys to localized messages, and the locale component is used by the <fmt:message>, <fmt:formatNumber>, <fmt:parseNumber>, <fmt:formatDate>, and <fmt:parseDate> actions as their formatting or parsing locale, respectively.
Constructor and Description |
---|
LocalizationContext()
Constructs an empty I18N localization context.
|
LocalizationContext(ResourceBundle bundle)
Constructs an I18N localization context from the given resource bundle.
|
LocalizationContext(ResourceBundle bundle,
Locale locale)
Constructs an I18N localization context from the given resource bundle
and locale.
|
Modifier and Type | Method and Description |
---|---|
Locale |
getLocale()
Gets the locale of this I18N localization context.
|
ResourceBundle |
getResourceBundle()
Gets the resource bundle of this I18N localization context.
|
public LocalizationContext()
public LocalizationContext(ResourceBundle bundle, Locale locale)
The specified locale is the application- or browser-based preferred locale that led to the resource bundle match.
bundle
- The localization context's resource bundlelocale
- The localization context's localepublic LocalizationContext(ResourceBundle bundle)
The localization context's locale is taken from the given resource bundle.
bundle
- The resource bundlepublic ResourceBundle getResourceBundle()
public Locale getLocale()
Copyright © 2019 Eclipse Foundation.
Use is subject to license terms.