Interface LocaleMatcher
- All Known Subinterfaces:
Strings
- All Known Implementing Classes:
DefaultStrings
public interface LocaleMatcher
Contract for matching an input
Locale or List<Locale.LanguageRange> to an appropriate localized strings Locale.- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbestMatchFor(List<Locale.LanguageRange> languageRanges) Given a list of language ranges (e.g. as parsed from anAccept-LanguageHTTP request header), determine the best-matching localized strings file's locale.bestMatchFor(Locale locale) Given a language range, determine the best-matching localized strings file's locale.
-
Method Details
-
bestMatchFor
Given a language range, determine the best-matching localized strings file's locale.- Parameters:
locale- the locale for which to find the best match.- Returns:
- the best-matching locale, not null
-
bestMatchFor
Given a list of language ranges (e.g. as parsed from anAccept-LanguageHTTP request header), determine the best-matching localized strings file's locale.- Parameters:
languageRanges- the ordered list of language ranges for which to find the best match.- Returns:
- the best-matching locale, not null
-