Class LocaleService

java.lang.Object
fr.paris.lutece.portal.web.l10n.LocaleService

public final class LocaleService extends Object
LocaleService
  • 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 request
      locale - The locale
    • getUserSelectedLocale

      public static Locale getUserSelectedLocale(javax.servlet.http.HttpServletRequest request)
      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

      public static Locale getDefault()
      Return a Lutece defined default Locale
      Returns:
      The locale
    • getContextUserLocale

      public 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
      Parameters:
      request - The HTTP request
      Returns:
      The locale
    • isSupported

      public static boolean isSupported(Locale locale)
      check if Locale is supported according to locale list in lutece properties
      Parameters:
      locale -
      Returns:
      true if supported
    • getSupportedLangList

      public static List<Locale> getSupportedLangList()
      get Supported Lang List
      Returns:
      the Supported Lang List