Class LocaleUtil

java.lang.Object
com.pingidentity.sdk.locale.LocaleUtil

public final class LocaleUtil extends Object
Utility class containing locale related helper functions.
Since:
9.0
  • Method Summary

    Modifier and Type
    Method
    Description
    static Locale
    getUserLocale(jakarta.servlet.http.HttpServletRequest request)
    Determine a user's locale from the given HttpServletRequest.
    static Locale
    getUserLocale(javax.servlet.http.HttpServletRequest request)
    Deprecated, for removal: This API element is subject to removal in a future version.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getUserLocale

      @Deprecated(since="13.1", forRemoval=true) public static Locale getUserLocale(javax.servlet.http.HttpServletRequest request)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Determine a user's locale from the given HttpServletRequest. How the locale is chosen depends on the underlying configuration within PingFederate which may involve reading the Accept-Language request header, reading a cookie value or logic defined in a custom LocaleOverrideService.

      The locale returned may then be used to localize the user interface using LanguagePackMessages and TemplateRendererUtil.

      Parameters:
      request - The HttpServletRequest from the user's browser.
      Returns:
      The user's preferred locale.
      Since:
      9.0
    • getUserLocale

      public static Locale getUserLocale(jakarta.servlet.http.HttpServletRequest request)
      Determine a user's locale from the given HttpServletRequest. How the locale is chosen depends on the underlying configuration within PingFederate which may involve reading the Accept-Language request header, reading a cookie value or logic defined in a custom LocaleOverrideService.

      The locale returned may then be used to localize the user interface using LanguagePackMessages and TemplateRendererUtil.

      Parameters:
      request - The HttpServletRequest from the user's browser.
      Returns:
      The user's preferred locale.
      Since:
      9.0