code: private static LocalizationContext findMatch(PageContext pageContext,
              String basename) {
          LocalizationContext locCtxt = null;
  
          // Determine locale from client's browser settings.
          for (Enumeration enum_ = Util
                  .getRequestLocales((HttpServletRequest) pageContext
                          .getRequest()); enum_.hasMoreElements();) {
              Locale pref = (Locale) enum_.nextElement();
              ResourceBundle match = findMatch(basename, pref);
              if (match != null) {
                  locCtxt = new LocalizationContext(match, pref);
                  break;
              }
          }
  
          return locCtxt;
      }
docs: Determines the client's preferred locales from the request, and compares
  each of the locales (in order of preference) against the available
  locales in order to determine the best matching locale.
  
  @param pageContext the page in which the resource bundle with the given
  base name is requested @param basename the resource bundle's base name
  
  @return the localization context containing the resource bundle with the
  given base name and best matching locale, or <tt>null</tt> if no
  resource bundle match was found