Available Methods
- getDefault ( )
- setDefault ( )
- US
- ENGLISH
- forLanguageTag ( )
- getLanguage ( )
- equals ( )
- ROOT
- getCountry ( )
- getAvailableLocales ( )
- FRENCH
- toString ( )
- UK
- GERMANY
- GERMAN
- CHINA
- getVariant ( )
- Builder ( )
- getDisplayName ( )
- JAPAN
- toLanguageTag ( )
- FRANCE
- getUnicodeLocaleType ( )
- JAPANESE
- getDisplayLanguage ( )
- CHINESE
- getISOLanguages ( )
- hasExtensions ( )
- stripExtensions ( )
- getDisplayCountry ( )
- SIMPLIFIED_CHINESE
- TRADITIONAL_CHINESE
- CANADA
- getUnicodeLocaleAttributes ( )
- ITALIAN
- TAIWAN
- hashCode ( )
- getISOCountries ( )
- clone ( )
- LanguageRange ( )
- ITALY
- getISO3Country ( )
- CANADA_FRENCH
- getExtensionKeys ( )
- getDisplayScript ( )
- getScript ( )
- KOREA
- getDisplayVariant ( )
- PRC
- getISO3Language ( )
- getUnicodeLocaleKeys ( )
- Category ( )
- KOREAN
- filter ( )
- lookup ( )
Related Classes
- java.util.Arrays
- java.io.File
- java.util.Collections
- java.io.InputStream
- android.os.Bundle
- android.content.Context
- android.view.View
- java.util.Date
- java.util.Iterator
- android.util.Log
- android.widget.TextView
- java.net.URL
- android.content.Intent
- java.text.SimpleDateFormat
- java.util.regex.Matcher
- android.os.Build
- java.util.LinkedList
- java.util.Properties
- java.util.stream.Collectors
- android.net.Uri
- java.nio.charset.Charset
- java.util.Calendar
- java.net.URI
- android.text.TextUtils
- org.junit.Assert
Java Code Examples for java.util.Locale#filter()
The following examples show how to use
java.util.Locale#filter() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ResteasyContextLocaleResolver.java From quarkus with Apache License 2.0 | 5 votes |
@Override public Locale resolve(LocaleResolverContext context) { Optional<List<LanguageRange>> localePriorities = getAcceptableLanguages(); if (!localePriorities.isPresent()) { return context.getDefaultLocale(); } List<Locale> resolvedLocales = Locale.filter(localePriorities.get(), context.getSupportedLocales()); if (resolvedLocales.size() > 0) { return resolvedLocales.get(0); } return context.getDefaultLocale(); }
Example 2
Source File: BaseLogin.java From syncope with Apache License 2.0 | 4 votes |
LocaleDropDown(final String id) { super(id, getSupportedLocales()); setChoiceRenderer(new LocaleRenderer()); setModel(new IModel<Locale>() { private static final long serialVersionUID = -6985170095629312963L; @Override public Locale getObject() { return getSession().getLocale(); } @Override public void setObject(final Locale object) { getSession().setLocale(object); } @Override public void detach() { // Empty. } }); // set default language selection List<Locale> filtered = List.of(); String acceptLanguage = ((ServletWebRequest) RequestCycle.get().getRequest()). getHeader(HttpHeaders.ACCEPT_LANGUAGE); if (StringUtils.isNotBlank(acceptLanguage)) { try { filtered = Locale.filter(Locale.LanguageRange.parse(acceptLanguage), getSupportedLocales()); } catch (Exception e) { LOG.debug("Could not parse {} HTTP header value '{}'", HttpHeaders.ACCEPT_LANGUAGE, acceptLanguage, e); } } getModel().setObject(filtered.isEmpty() ? Locale.ENGLISH : filtered.get(0)); }