code: public static Locale getLocaleForName(String name) {
  
          String suffix = getLocaleSuffixForName(CmsResource.getName(name));
          if (suffix != null) {
              String laguageString = suffix.substring(0, 2);
              return suffix.length() == 5 ? new Locale(laguageString, suffix.substring(3, 5)) : new Locale(laguageString);
          }
          return null;
      }
docs: Returns a Locale calculated from the suffix of the given String, or <code>null</code> if no locale suffix is found.<p>
  
  The locale returned will include the optional country code if this was part of the suffix.<p>
  
  Calls {@link CmsResource#getName(String)} first, so the given name can also be a resource root path.<p>
  
  <b>Directly exposed for JSP EL</b>, not through {@link org.opencms.jsp.util.CmsJspElFunctions}.<p>
  
  @param name the name to get the locale for
  
  @return the locale, or <code>null</code>
  
  @see #getLocaleSuffixForName(String)