Class LocaleAccessor
java.lang.Object
com.sap.cloud.sdk.cloudplatform.servlet.LocaleAccessor
Accessor for retrieving the current
Locale
.-
Method Summary
Modifier and TypeMethodDescriptionstatic Locale
Returns the requested locale of the current HTTP request, or default locale of the server.Returns a list of locales indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header.static LocaleFacade
TheLocaleFacade
instance.static void
setLocaleFacade
(LocaleFacade localeFacade) Replaces the defaultLocaleFacade
instance.
-
Method Details
-
setLocaleFacade
Replaces the defaultLocaleFacade
instance.- Parameters:
localeFacade
- An instance ofLocaleFacade
. Usenull
to reset the facade.
-
getCurrentLocale
Returns the requested locale of the current HTTP request, or default locale of the server.- Returns:
- The locale.
-
getCurrentLocales
Returns a list of locales indicating, in decreasing order starting with the preferred locale, the locales that are acceptable to the client based on the Accept-Language header. If the client request doesn't provide an "Accept-Language" header, this method returns a list containing one locale, the default locale of the server.- Returns:
- A list of locales.
-
getLocaleFacade
TheLocaleFacade
instance.
-