doc / ch.tutteli.atrium.reporting.translating

Package ch.tutteli.atrium.reporting.translating

Everything involved in translating Translatables.

Types

ArgumentsSupportingTranslator

abstract class ArgumentsSupportingTranslator : Translator

Represents a Translator which supports TranslatableWithArgs.

Locale

data class Locale

Represents a platform independent representation of a locale consisting of a language, a script, a country and a variant.

LocaleOrderDecider

interface LocaleOrderDecider

Responsible to decide in which order Locales should be processed.

LocaleProvider

interface LocaleProvider

PropertiesBasedTranslationSupplier

abstract class PropertiesBasedTranslationSupplier<in T> : TranslationSupplier

A base class for properties based TranslationSuppliers which provides a loading and caching mechanism of properties files.

PropertiesPerEntityAndLocaleTranslationSupplier

class PropertiesPerEntityAndLocaleTranslationSupplier : PropertiesBasedTranslationSupplier<String>

Represents a TranslationSupplier which is based on properties-files which are structured per entity (enum, object or class) and Locale.

PropertiesPerLocaleTranslationSupplier

class PropertiesPerLocaleTranslationSupplier : PropertiesBasedTranslationSupplier<Locale>

Represents a TranslationSupplier which is based on properties-files which are structured per Locale.

StringBasedTranslatable

interface StringBasedTranslatable : Translatable

Something which is Translatable and provides a default representation by value.

Translatable

interface Translatable

Something which is translatable, identified by id with a default representation given by getDefault.

TranslatableWithArgs

data class TranslatableWithArgs : Translatable

A Translatable which contains placeholders for arguments.

TranslationSupplier

interface TranslationSupplier

A supplier of translations for Translatables for particular Locales.

Translator

interface Translator

Represents a translator of Translatables.

Untranslatable

class Untranslatable : Translatable

Represents a Translatable which is not translatable but has only a fixed name which serves as getDefault.

UseDefaultLocaleAsPrimary

object UseDefaultLocaleAsPrimary : LocaleProvider

UsingDefaultTranslator

class UsingDefaultTranslator : ArgumentsSupportingTranslator

This translator does not translate but uses Translatable.getDefault instead and uses getDefaultLocale as primaryLocale if not defined differently via constructor parameter.

Functions

getDefaultLocale

expect fun getDefaultLocale(): Locale

Returns the default Locale which should be used if not defined otherwise.

toJavaLocale

fun Locale.toJavaLocale(): Locale

Transforms this Locale into a java.util.Locale.