Class DefaultLocaleProvider
java.lang.Object
org.nuxeo.ecm.platform.web.common.locale.DefaultLocaleProvider
- All Implemented Interfaces:
LocaleProvider
- Direct Known Subclasses:
UserLocaleProvider
Provides the default locale and timezone from the server.
- Since:
- 5.6
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Locale
protected TimeZone
getLocale
(CoreSession repo) getLocale
(DocumentModel userProfileDoc) Gets the locale stored in the given user profile.getLocaleWithDefault
(String requestedLocale) Returns the default locale for given requested locale.getLocaleWithDefault
(CoreSession session) getLocaleWithDefault
(DocumentModel userProfileDoc) getTimeZone
(CoreSession repo)
-
Constructor Details
-
DefaultLocaleProvider
public DefaultLocaleProvider()
-
-
Method Details
-
getLocale
- Specified by:
getLocale
in interfaceLocaleProvider
- Returns:
- the Locale to be used or null to let the caller decides.
-
getLocale
Description copied from interface:LocaleProvider
Gets the locale stored in the given user profile.- Specified by:
getLocale
in interfaceLocaleProvider
- Returns:
- the Locale to be used or null to let the caller decide
-
getTimeZone
- Specified by:
getTimeZone
in interfaceLocaleProvider
- Returns:
- the Timezone to be used or null to let the caller decides.
-
getLocaleWithDefault
- Specified by:
getLocaleWithDefault
in interfaceLocaleProvider
- Returns:
- the Locale to be used or a default Locale
-
getLocaleWithDefault
- Specified by:
getLocaleWithDefault
in interfaceLocaleProvider
- Returns:
- the Locale stored in userProfile or a default Locale
-
getLocaleWithDefault
Description copied from interface:LocaleProvider
Returns the default locale for given requested locale.Checks if requested locale is part of supported locales, and fall-backs on a default locale if not (or if requested locale is empty).
- Specified by:
getLocaleWithDefault
in interfaceLocaleProvider
-
getDefaultLocale
-
getDefaultTimezone
-