Class LocaleAccessor
java.lang.Object
com.sap.cloud.sdk.cloudplatform.servlet.LocaleAccessor
Accessor for retrieving the current
Locale.-
Method Summary
Modifier and TypeMethodDescriptionstatic LocaleReturns 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 LocaleFacadeTheLocaleFacadeinstance.static voidsetLocaleFacade(LocaleFacade localeFacade) Replaces the defaultLocaleFacadeinstance.
-
Method Details
-
setLocaleFacade
Replaces the defaultLocaleFacadeinstance.- Parameters:
localeFacade- An instance ofLocaleFacade. Usenullto 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
TheLocaleFacadeinstance.
-