atrium-impl-robstoll / ch.tutteli.atrium.reporting.translating / Translator

Translator

class Translator : ArgumentsSupportingTranslator

Represents an ITranslator which uses an ITranslationSupplier to retrieve translations and LocaleOrderDecider to determine in which order it should try to find translations for a given ITranslatable.

Constructors

<init>

Translator(translationSupplier: ITranslationSupplier, primaryLocale: Locale, fallbackLocales: Array<out Locale>)

Inherited Properties

primaryLocale

val primaryLocale: Locale

The Locale to which the translator translates per default as well as the Locale which will be used in java.lang.String.format, which in turn is used to substitute the placeholders in the resulting translation of ITranslatableWithArgs.translatable with the ITranslatableWithArgs.arguments.

Functions

translateWithoutArgs

fun translateWithoutArgs(translatable: ITranslatable): String

Do not call this method in case you want to translate a ITranslatableWithArgs use translate in this case.

Inherited Functions

translate

fun translate(translatable: ITranslatable): String

Returns the translation of the given translatable or its getDefault in case there is not a translation defined for it.