in locales-common/src/main/java/com/spotify/i18n/locales/common/model/ResolvedLocale.java [171:206]
public abstract Builder localeForTranslationsFallbacks(
final List<ULocale> localeForTranslationsFallbacks);
/**
* Configures the locale to be used to apply formatting on Strings. It can be any descendant of
* the highest non-ROOT ancestor locale of the {@link #localeForTranslations()}, according to
* the CLDR locales hierarchy.
*
* @param localeForFormatting best matching locale for formatting, compatible for usage with the
* {@link #localeForTranslations()}
* @return The {@link Builder} instance
*/
public abstract Builder localeForFormatting(final ULocale localeForFormatting);
abstract ResolvedLocale autoBuild(); // not public
/**
* Builds a {@link ResolvedLocale} out of this builder.
*
* <ul>
* <li>All provided locales will be validated as normalized and canonicalized.
* <li>Their availability in CLDR will be checked and enforced
* <li>Locales hierarchy will be validated and enforced for all
* </ul>
*
* <p>This is safe to be called several times on the same builder.
*
* @throws IllegalStateException if any of the builder property does not match the requirements.
*/
public final ResolvedLocale build() {
ResolvedLocale resolvedLocale = autoBuild();
validateLocaleForTranslations(resolvedLocale);
validateLocaleForTranslationsFallbacks(resolvedLocale);
validateLocaleForFormatting(resolvedLocale);
return resolvedLocale;
}