public class LocaleUtils extends Object
| Constructor and Description |
|---|
LocaleUtils(CdsProperties properties) |
| Modifier and Type | Method and Description |
|---|---|
Locale |
getLocale(String sapLanguageQueryParam,
String xSapLanguageHeader,
String acceptLanguageHeader)
Determines the locale for a request.
|
static Locale |
getLocaleForBundle(Locale locale)
Determines the locale used for resource bundle lookups
|
static String |
getLocaleStringForQuery(Locale locale)
Returns the correct locale String for the sap-language query parameter
|
static String |
getLocalizedEntityName(String entity)
Calculates the localized entity name that can be used to access localized
fields
|
public LocaleUtils(CdsProperties properties)
public Locale getLocale(String sapLanguageQueryParam, String xSapLanguageHeader, String acceptLanguageHeader)
sapLanguageQueryParam - Value of "sap-language"query parameterxSapLanguageHeader - Value of "x-sap-request-language" query parameteracceptLanguageHeader - Value of accepted language header parameterpublic static String getLocalizedEntityName(String entity)
entity - the entity namepublic static String getLocaleStringForQuery(Locale locale)
locale - the localeCopyright © 2021. All rights reserved.