public final class Locales extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
getCountry(String localeString)
Gets country from the specified locale string.
|
static String |
getLanguage(String localeString)
Gets language from the specified locale string.
|
static Locale |
getLocale()
Gets locale.
|
static Locale |
getLocale(Request request)
Gets locale with the specified request.
|
static Locale |
getLocale(String localeString)
Gest a
Locale with the specified locale string. |
static boolean |
hasLocale(Locale locale)
Determines whether the server has the specified locale configuration or not.
|
static void |
setLocale(Locale locale)
Sets locale.
|
static void |
setLocale(Request request,
Locale locale)
Sets the specified locale into session of the specified request.
|
public static Locale getLocale(Request request)
By the following steps:
server configurationrequest - the specified requestpublic static boolean hasLocale(Locale locale)
locale - the specified localetrue if the server has the specified locale, false otherwisepublic static void setLocale(Request request, Locale locale)
If no session of the specified request, do nothing.
request - the specified requestlocale - a new localepublic static void setLocale(Locale locale)
locale - the specified localepublic static Locale getLocale()
public static String getCountry(String localeString)
localeString - the specified locale stringpublic static String getLanguage(String localeString)
localeString - the specified locale stringCopyright © 2009–2019 B3log. All rights reserved.