code: public Locale getLocale() {
  
          Object result = getStateHelper().eval(PropertyKeys.locale);
  
          if (result != null) {
              Locale locale = null;
              if (result instanceof Locale) {
                      locale = (Locale) result;
              } else if (result instanceof String) {
                     locale = getLocaleFromString((String) result);
              }
              return locale;
          } else {
              FacesContext context = getFacesContext();
              return context.getApplication().getViewHandler().calculateLocale(context);
          }
  
      }
docs: <p>Return the <code>Locale</code> to be used in localizing the
  response being created for this view.</p>
  <p/>
  <p>Algorithm:</p>
  <p/>
  <p>If we have a <code>locale</code> ivar, return it.  If we have
  a value expression for "locale", get its value.  If the value is
  <code>null</code>, return the result of calling {@link
  javax.faces.application.ViewHandler#calculateLocale}.  If the
  value is an instance of <code>java.util.Locale</code> return it.
  If the value is a String, convert it to a
  <code>java.util.Locale</code> and return it.  If there is no
  value expression for "locale", return the result of calling {@link
  javax.faces.application.ViewHandler#calculateLocale}.</p>
  
  @return The current <code>Locale</code> obtained by executing the
  above algorithm.