Interface TranslationFallbackPolicy

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

Decides whether a failed locale attempt should continue to the next locale candidate.

This policy is intentionally separate from TranslationFailureHandler: fallback policy controls which locale candidates are attempted, while the failure handler controls the final response after fallback stops or all candidates are exhausted.

A failure while evaluating a reachable expression-fragment predicate or interpolating its selected/default fragment is a TranslationFailureReason.RESOLUTION_FAILURE. The safe default fallbackOnMissingTranslationOrNoMatchingAlternative() stops at that failure; fallbackOnAnyFailure() may continue to another locale candidate. Expression-selected generated fragments always have a default translation, so their selection cannot itself produce TranslationFailureReason.NO_MATCHING_ALTERNATIVE.

Implementations may be invoked concurrently and must be thread-safe when shared by a Strings instance.

Since:
3.0.0
Author:
Mark Allen