Package fr.paris.lutece.portal.web.l10n
Class LocaleService
java.lang.Object
fr.paris.lutece.portal.web.l10n.LocaleService
LocaleService
-
Method Summary
Modifier and TypeMethodDescriptionstatic LocalegetContextUserLocale(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 localestatic LocaleReturn a Lutece defined default Localeget Supported Lang Liststatic LocalegetUserSelectedLocale(javax.servlet.http.HttpServletRequest request) Get a Locale selected by the user in front officestatic booleanisSupported(Locale locale) check if Locale is supported according to locale list in lutece propertiesstatic voidsetUserSelectedLocale(javax.servlet.http.HttpServletRequest request, Locale locale) Set the locale selected by the user in the front office.
-
Method Details
-
setUserSelectedLocale
public static void setUserSelectedLocale(javax.servlet.http.HttpServletRequest request, Locale locale) Set the locale selected by the user in the front office. The user may select a language without been authenticated.- Parameters:
request- The requestlocale- The locale
-
getUserSelectedLocale
Get a Locale selected by the user in front office- Parameters:
request- The HTTP request- Returns:
- The locale selected, or the default jvm locale if no locale has been selected
-
getDefault
Return a Lutece defined default Locale- Returns:
- The locale
-
getContextUserLocale
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- Parameters:
request- The HTTP request- Returns:
- The locale
-
isSupported
check if Locale is supported according to locale list in lutece properties- Parameters:
locale-- Returns:
- true if supported
-
getSupportedLangList
get Supported Lang List- Returns:
- the Supported Lang List
-