public final class LocaleUtilInternal extends Object
Modifier and Type | Field and Description |
---|---|
static String |
LOCALE_COOKIE_NAME
Locale cookie name.
|
Constructor and Description |
---|
LocaleUtilInternal() |
Modifier and Type | Method and Description |
---|---|
static org.json.simple.JSONObject |
extractJsonObject(LocaleConfig locale)
Transform Locale to JsonObject
Example:
{
"label" : "português (Brasil)",
"value" : "pt_BR"
}
|
static boolean |
isCurrentLocaleValid(ChannelConfig channel)
Returns whether the session locale is valid for a given channel.
|
static void |
markSessionLocaleToBeUpdated(HttpServletRequest request)
Marks the session to have the locale updated.
|
static void |
markSessionLocaleUpdated(HttpServletRequest request)
Mark the session as having the locale updated.
|
static Locale |
selectLocale(HttpServletRequest request,
ChannelConfig channel)
Returns the selected locale for a given channel and request.
|
static void |
setCookie(Locale locale,
HttpServletRequest request,
HttpServletResponse response)
Sets the locale cookie using the given locale as value.
|
static boolean |
shouldUpdateSessionLocale(HttpServletRequest request)
Returns whether the session locale should be updated.
|
public static final String LOCALE_COOKIE_NAME
public static Locale selectLocale(HttpServletRequest request, ChannelConfig channel) throws PortalException
request
- the request.channel
- the channel.PortalException
public static void setCookie(Locale locale, HttpServletRequest request, HttpServletResponse response)
locale
- the locale.request
- the request.response
- the response.public static boolean shouldUpdateSessionLocale(HttpServletRequest request)
request
- the request.public static void markSessionLocaleToBeUpdated(HttpServletRequest request)
request
- the request.public static void markSessionLocaleUpdated(HttpServletRequest request)
request
- the request.public static boolean isCurrentLocaleValid(ChannelConfig channel) throws PortalException
channel
- the channel.PortalException
public static org.json.simple.JSONObject extractJsonObject(LocaleConfig locale)
locale
- LumisXP 12.5.0.200928 - Copyright © 2006–2020 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.