LocaleOrderDecider

Responsible to decide in which order Locales should be processed.

It should follow Java's Locale conventions (e.g. locales are written with _ and not with -). To put it differently it should be more or less compatible with Java's ResourceBundle.Control.getCandidateLocales except for:

  • special case Norwegian; language no does not need to be considered, is not supported by Translator.

  • special case Chinese; language zh with script Hant or Hans without providing a country does not need to be treated specially because Translator does not support it. However, it still has to set script to Hant or Hans in case script is not defined by the user but country was.

  • java.util.Locale.ROOT does not exist for in Atrium's Locale.

Inheritors

Functions

Link copied to clipboard
abstract fun determineOrder(primaryLocale: Locale, fallbackLocales: List<Locale>): Sequence<Locale>

Defines the Sequence of Locales which should be used in Translator.translate.