public final class LocaleService extends Object
Modifier and Type | Method and Description |
---|---|
static Locale |
getContextUserLocale(javax.servlet.http.HttpServletRequest request)
Retrieve the best supported locale for the user's session Priority order : 1- selected locale session attribute 2- browser locale (if supported) 3-
default server locale
|
static Locale |
getDefault()
Return a Lutece defined default Locale
|
static List<Locale> |
getSupportedLangList()
get Supported Lang List
|
static Locale |
getUserSelectedLocale(javax.servlet.http.HttpServletRequest request)
Get a Locale selected by the user in front office
|
static boolean |
isSupported(Locale locale)
check if Locale is supported according to locale list in lutece properties
|
static void |
setUserSelectedLocale(javax.servlet.http.HttpServletRequest request,
Locale locale)
Set the locale selected by the user in the front office.
|
public static void setUserSelectedLocale(javax.servlet.http.HttpServletRequest request, Locale locale)
request
- The requestlocale
- The localepublic static Locale getUserSelectedLocale(javax.servlet.http.HttpServletRequest request)
request
- The HTTP requestpublic static Locale getDefault()
public static Locale getContextUserLocale(javax.servlet.http.HttpServletRequest request)
request
- The HTTP requestpublic static boolean isSupported(Locale locale)
locale
- Copyright © 2020 City of Paris. All rights reserved.