public class DefaultLocaleProvider extends java.lang.Object implements LocaleProvider
AbstractItemModel. It wraps the I18NService.| Constructor and Description |
|---|
DefaultLocaleProvider(I18NService i18NService) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Locale |
getCurrentDataLocale()
Returns current (session) data locale to be used to read or store localized attribute data.
|
java.util.List<java.util.Locale> |
getFallbacks(java.util.Locale requested)
Returns a
List with fallback Locales for the given Locale. |
boolean |
isFallbackEnabled()
Returns
true if for the current session the Locale fallback is enabled. |
protected I18NService |
service() |
java.util.Locale |
toDataLocale(java.util.Locale external)
Converts a arbitrary locale instance into one which is allowed to read and write data with.
|
public DefaultLocaleProvider(I18NService i18NService)
protected I18NService service()
public java.util.Locale getCurrentDataLocale()
LocaleProviderI18NService.getCurrentLocale()!getCurrentDataLocale in interface LocaleProviderpublic java.util.Locale toDataLocale(java.util.Locale external)
LocaleProvidertoDataLocale in interface LocaleProviderexternal - the localepublic java.util.List<java.util.Locale> getFallbacks(java.util.Locale requested)
LocaleProviderList with fallback Locales for the given Locale.getFallbacks in interface LocaleProviderrequested - the Locale for which all fallback Locales are requested.null if the locale fallback is not enabled (see LocaleProvider.isFallbackEnabled()).public boolean isFallbackEnabled()
LocaleProvidertrue if for the current session the Locale fallback is enabled.isFallbackEnabled in interface LocaleProviderfalse otherwise.Copyright © 2018 SAP SE. All Rights Reserved.