resolveLocale method

Intl resolveLocale (
  1. ForceRequest request

Resolve the current locale via the given request. Should return a default locale as fallback in any case. @param request the request to resolve the locale for @return the current locale (never null)


Intl resolveLocale(ForceRequest request) {
  // Retrieve and parse cookie value.
  Cookie cookie = cookieManager.getCookie(request.request);
  if (cookie != null) {
      // ... todo for see implementation
//        Intl locale = Intl.parseString(cookie.value); //StringUtils.parseLocaleString(cookie.value); How will I parse the cookie to a locale
Intl locale = new Intl(cookie.value);
      if (locale != null) {
          return locale;

  return determineDefaultLocale(request);