Class LocalizedStringLoader

java.lang.Object
com.lokalized.LocalizedStringLoader

@ThreadSafe public final class LocalizedStringLoader extends Object
Utility methods for loading localized strings files.

Map-returning load methods return unmodifiable maps containing unmodifiable sets. Their locales iterate in ascending Locale.toLanguageTag() order. Key lookup and map equality retain ordinary Locale.equals(Object) semantics. All parse(...) methods return unmodifiable sets.

A generated placeholder may be language-form-driven (LocalizedString.LanguageFormTranslation; localized strings file members value or range, plus translations) or template-driven (LocalizedString.ExpressionTranslation; a required default translation, plus optional ordered expression alternatives). Template alternatives select string fragments only; the first matching expression wins and the required default is used when none match. Placeholder modes are mutually exclusive, and all expressions and fragment placeholder references are validated while loading.

Unicode letter, number, and mark membership in placeholder and expression identifiers follows the executing JDK's Pattern Unicode tables. Author files for the oldest JDK in the deployment fleet when the same files must be portable across runtime versions; [A-Za-z_][A-Za-z0-9_-]* is the portable ASCII subset.

Author:
Mark Allen