doc / ch.tutteli.atrium / IAtriumFactory / newTranslator

newTranslator

abstract fun newTranslator(translationSupplier: ITranslationSupplier, primaryLocale: Locale, vararg fallbackLocales: Locale): ITranslator

Creates an ITranslator which translates ITranslatables to primaryLocale and falls back to fallbackLocales (in the given order) in case no translation exists for primaryLocale.

In case neither a translation exists for any fallbackLocales then it uses ITranslatable's getDefault. It uses the given translationSupplier to retrieve all available translations.

Parameters

translationSupplier - Provides the translations for primaryLocale - The Locale to which the translator translates per default. fallbackLocales - Used in case a translation for a given ITranslatable is not defined for primaryLocale or one of its secondary alternatives -- the fallback Locales are used in the given order.

Return
The newly created translator.