public final class LocaleSAP extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
convertToLocaleABAP(Locale oLocale)
Returns the locale in ABAP format(language and country in two character
upper case format) Example: EN_US, DE_DE, FR_CA
|
static String |
convertToLocaleABAP(String sLocale)
Returns the locale in ABAP format(language and country in two character
upper case format) Example: EN_US, DE_DE, FR_CA
|
static String |
convertToLocaleBCP47(Locale oLocale)
Returns the locale in BCP47 format (language in two letter lower case and country in two character
upper case format) Example: en-US, de-DE, fr-CA
|
static String |
convertToLocaleBCP47(String sLocale)
Returns the locale in BCP47 format (language in 2 letter lower case and country in two character
upper case format) Example: en-US, de-DE, fr-CA
|
static String |
convertToLocaleSAP(Locale oLocale)
Converts a java locale to a one character LOCALE_SAP.
|
static String |
convertToLocaleSAP(String sLocale)
Converts a java locale to a one character LOCALE_SAP.
|
static String |
parseAcceptLanguage(String sAcceptLanguage)
Parses a string in accept-language format and returns the locale with the highest weight
|
static List<String> |
parseAcceptLanguagesIgnoringWeights(String sAcceptLanguage)
Parses a string in accept-language format and returns a list of the locales in the order passed, ignoring weights
|
static Connection |
setLocale(Connection oConnection,
String sLocale)
Sets the locales LOCALE_SAP and LOCALE_BCP47 in the HANA session context.
|
public static String parseAcceptLanguage(String sAcceptLanguage)
sAcceptLanguage - the string to parsepublic static List<String> parseAcceptLanguagesIgnoringWeights(String sAcceptLanguage)
sAcceptLanguage - the string to parsepublic static String convertToLocaleSAP(Locale oLocale)
oLocale - the java locale as a java.util.Locale objectpublic static String convertToLocaleSAP(String sLocale)
sLocale - the java locale as a stringpublic static String convertToLocaleABAP(String sLocale)
sLocale - the locale to convert as a stringpublic static String convertToLocaleABAP(Locale oLocale)
oLocale - the locale to convert as a java.util.locale objectpublic static String convertToLocaleBCP47(String sLocale)
sLocale - the locale to convert as a stringpublic static String convertToLocaleBCP47(Locale oLocale)
oLocale - the locale to convert as a java.util.locale objectpublic static Connection setLocale(Connection oConnection, String sLocale) throws SQLClientInfoException
oConnection - The database connection to set the locales for via ClientInfosLocale - the locale as a stringSQLClientInfoException - if there is a SQL client connection errorCopyright © 2016 SAP. All Rights Reserved.