List of usage examples for org.apache.commons.lang3 LocaleUtils localeLookupList
public static List<Locale> localeLookupList(final Locale locale, final Locale defaultLocale)
Obtains the list of locales to search through when performing a locale search.
localeLookupList(Locale("fr", "CA", "xxx"), Locale("en")) = [Locale("fr","CA","xxx"), Locale("fr","CA"), Locale("fr"), Locale("en"]
The result list begins with the most specific locale, then the next more general and so on, finishing with the default locale.
From source file:org.xwiki.search.solr.internal.SolrIndexAvailableLocalesListener.java
/** * @param locale the locale//from w ww . j av a 2 s .co m * @return the parents of the locale */ private Set<Locale> getParentLocales(Locale locale) { Set<Locale> parentLocales = new HashSet<Locale>(LocaleUtils.localeLookupList(locale, Locale.ROOT)); parentLocales.remove(locale); return parentLocales; }