docs: public static Locale resolveLocale(Object locale, String clientId) {
          Locale result = null;
  
          if (locale != null) {
              if (locale instanceof String) {
                  result = toLocale((String) locale);
              }
              else if (locale instanceof java.util.Locale) {
                  result = (java.util.Locale) locale;
              }
              else {
                  throw new IllegalArgumentException("Type:" + locale.getClass() + " is not a valid locale type for: " + clientId);
              }
          }
          else {
              // default to the view local
              result = FacesContext.getCurrentInstance().getViewRoot().getLocale();
          }
  
          return result;
      }