/** * Return all the accepted locales. This implementation always returns just one. * * @return The locales */ public Enumeration getLocales() { List list = new ArrayList(1); list.add(getLocale()); return Collections.enumeration(list); }
/** * Return all the accepted locales. This implementation always returns just one. * * @return The locales */ public Enumeration<Locale> getLocales() { List<Locale> list = new ArrayList<Locale>(); final String header = getHeader("Accept-Language"); if (header != null) { final String[] locales = header.split(","); for (String value : locales) { Locale locale = getLocale(value); if (locale != null) { list.add(locale); } } } if (list.size() == 0) { list.add(Locale.getDefault()); } return Collections.enumeration(list); }