Package-level declarations

Types

Link copied to clipboard
data class DateComponents(val eraStyle: EraStyle? = Defaults.ERA, val yearStyle: YearStyle = Defaults.YEAR, val monthStyle: MonthStyle = Defaults.MONTH, val dayOfMonthStyle: DayOfMonthStyle = Defaults.DAY_OF_MONTH, val dayOfWeekStyle: DayOfWeekStyle? = Defaults.DAY_OF_WEEK) : DateStyleOptions, ComponentsOptions.Date.Components

Class defining the style for each component of a date (year, month and day).

Link copied to clipboard
data class DateOptions(val styleOptions: DateStyleOptions = Defaults.DATE) : PolyglotLocalizerOptions<LocalDateLocalizer>

Simple container class for DateStyleOptions.

Link copied to clipboard

Defines a preset date style for localizing a date (year, month and day).

Link copied to clipboard

Defines the localization style for a date (year, month and day).

Link copied to clipboard
actual class DurationLocalizer : <ERROR CLASS> ERROR CLASS: Symbol not found for PolyglotValueLocalizer<ERROR CLASS: Symbol not found for Duration, kotlin/String>

Localizer for Duration.

Link copied to clipboard
data class DurationOptions(val minUnit: DurationUnit = DurationUnit.SECONDS, val maxUnits: Int = 2, val omitZeros: Boolean = true, val style: DurationStyle = DurationStyle.WIDE, val ifZeroLocalization: (PlatformLocale) -> String? = { null }) : PolyglotLocalizerOptions<DurationLocalizer>

Localization options for DurationLocalizer and Duration.localize

Link copied to clipboard
@RequiresOptIn(message = "This API is experimental. It could change or be dropped in the future without notice.")
annotation class ExperimentalTickingDurationLocalizer
Link copied to clipboard

Localizer for LocalDate.

actual class LocalDateLocalizer : <ERROR CLASS> ERROR CLASS: Symbol not found for PolyglotDateTimeLocalizer<ERROR CLASS: Symbol not found for LocalDate>

Localizer for LocalDate.

Localizer for LocalDate.

Link copied to clipboard
expect class LocalDateTimeLocalizer : PolyglotDateTimeLocalizer<LocalDateTime>

Localizer for LocalDateTime.

actual class LocalDateTimeLocalizer : <ERROR CLASS> ERROR CLASS: Symbol not found for PolyglotDateTimeLocalizer<ERROR CLASS: Symbol not found for LocalDateTime>

Localizer for LocalDateTime.

actual class LocalDateTimeLocalizer : PolyglotDateTimeLocalizer<LocalDateTime>

Localizer for LocalDateTime.

Link copied to clipboard

Localization options for LocalDateTimeLocalizer and LocalDateTime.parse.

Link copied to clipboard
data class LocalTimeComponents(val hourStyle: HourStyle = Defaults.HOUR, val minuteStyle: MinuteStyle? = Defaults.MINUTE, val secondStyle: SecondStyle? = Defaults.SECOND, val fractionalSecondDigits: Int = Defaults.FRACTIONAL_SECONDS, val dayPeriodStyle: DayPeriodStyle? = Defaults.DAY_PERIOD) : TimeComponents, LocalTimeStyleOptions, ComponentsOptions.TimeStyleOptions.Components

Interface defining the style for each component of a local time.

Link copied to clipboard

Localizer for LocalTime.

actual class LocalTimeLocalizer : <ERROR CLASS> ERROR CLASS: Symbol not found for PolyglotDateTimeLocalizer<ERROR CLASS: Symbol not found for LocalTime>

Localizer for LocalTime.

Localizer for LocalTime.

Link copied to clipboard
data class LocalTimeOptions<out S : LocalTimeStyleOptions>(val styleOptions: S, val hourCycle: HourCycle? = Defaults.HOUR_CYCLE) : TimeOptions<S> , PolyglotLocalizerOptions<LocalTimeLocalizer>

Options to pass when localizing a local time (no timezone information).

Link copied to clipboard

Defines a preset time style for localizing a time with no time zone awareness

Link copied to clipboard

Options to pass to TimeOptions.styleOptions when localizing a time with no time zone awareness.

Link copied to clipboard

Localizes a Duration in the same exact way as a DurationLocalizer, but this is meant to be used to localize duration values that change over time (e.g. a countdown). For static durations use DurationLocalizer instead.

Link copied to clipboard
data class TickingDurationOptions(val durationOptions: DurationOptions = DurationOptions(), val abs: Boolean = false) : PolyglotLocalizerOptions<TickingDurationLocalizer>

Localization options for TickingDurationLocalizer and localizeTicking.

Link copied to clipboard
sealed interface TimeComponents : TimeStyleOptions

Interface defining the style for each component of a time.

Link copied to clipboard
sealed interface TimeOptions<out S : TimeStyleOptions>

Options to pass when localizing time.

Link copied to clipboard
sealed interface TimeStyle : TimeStyleOptions

Defines a preset time style for localizing a time.

Link copied to clipboard
sealed interface TimeStyleOptions

Options to pass to TimeOptions.styleOptions, that define the style of each time component.

Link copied to clipboard

Localizer for years (Int).

actual class YearLocalizer : <ERROR CLASS> ERROR CLASS: Symbol not found for PolyglotDateTimeLocalizer<kotlin/Int>

Localizer for years (Int).

Localizer for years (Int).

Link copied to clipboard

Localizer for YearMonth.

actual class YearMonthLocalizer : <ERROR CLASS> ERROR CLASS: Symbol not found for PolyglotDateTimeLocalizer<ERROR CLASS: Symbol not found for YearMonth>

Localizer for YearMonth.

Localizer for YearMonth.

Link copied to clipboard
data class YearMonthOptions(val eraStyle: EraStyle? = Defaults.ERA, val yearStyle: YearStyle = Defaults.YEAR, val monthStyle: MonthStyle? = Defaults.MONTH) : ComponentsOptions.Date.Components, PolyglotLocalizerOptions<YearMonthLocalizer>

Localization options for YearMonthLocalizer and YearMonth.localize.

Link copied to clipboard
data class YearOptions(val eraStyle: EraStyle? = Defaults.ERA, val yearStyle: YearStyle = Defaults.YEAR) : ComponentsOptions.Date.Components, PolyglotLocalizerOptions<YearLocalizer>

Localization options for YearLocalizer.

Link copied to clipboard
Link copied to clipboard

Localizer for an Instant paired with a TimeZone (see Zoned).

actual class ZonedInstantLocalizer : <ERROR CLASS> ERROR CLASS: Symbol not found for PolyglotDateTimeZonedLocalizer<ERROR CLASS: Symbol not found for Instant>

Localizer for an Instant paired with a TimeZone (see Zoned).

Localizer for an Instant paired with a TimeZone (see Zoned).

Link copied to clipboard
Link copied to clipboard
class ZonedLocalDateLocalizer(options: ZonedDateOptions = ZonedDateOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotDateTimeZonedLocalizer<LocalDate>

Localizer for Zoned<LocalDate>.

Link copied to clipboard
data class ZonedTimeComponents(val hourStyle: HourStyle = Defaults.HOUR, val minuteStyle: MinuteStyle? = Defaults.MINUTE, val secondStyle: SecondStyle? = Defaults.SECOND, val fractionalSecondDigits: Int = Defaults.FRACTIONAL_SECONDS, val dayPeriodStyle: DayPeriodStyle? = Defaults.DAY_PERIOD, val timeZoneStyle: TimeZoneStyle = Defaults.TIME_ZONE) : TimeComponents, ZonedTimeStyleOptions, ComponentsOptions.TimeStyleOptions.Components

Interface defining the style for each component of a zoned time.

Link copied to clipboard
data class ZonedTimeOptions<out S : ZonedTimeStyleOptions>(val styleOptions: S, val hourCycle: HourCycle? = Defaults.HOUR_CYCLE) : TimeOptions<S>

Options to pass when localizing a zoned time.

Link copied to clipboard

Defines a preset time style for localizing a time with time zone awareness

Link copied to clipboard

Options to pass to TimeOptions.styleOptions when localizing a time with time zone awareness.

Link copied to clipboard
class ZonedYearLocalizer(options: ZonedYearOptions = ZonedYearOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotDateTimeZonedLocalizer<Int>

Localizer for Zoned years (Zoned<Int>).

Link copied to clipboard
class ZonedYearMonthLocalizer(options: ZonedYearMonthOptions = ZonedYearMonthOptions(), locale: PlatformLocale = getDefaultLocale()) : PolyglotDateTimeZonedLocalizer<YearMonth>

Localizer for Zoned<YearMonth>.

Link copied to clipboard
data class ZonedYearMonthOptions(val yearMonthOptions: YearMonthOptions = YearMonthOptions(), val timeZoneOptions: TimeZoneOptions = TimeZoneOptions()) : PolyglotLocalizerOptions<ZonedYearMonthLocalizer>

Localization options for ZonedYearMonthLocalizer.

Link copied to clipboard
data class ZonedYearOptions(val yearOptions: YearOptions = YearOptions(), val timeZoneOptions: TimeZoneOptions = TimeZoneOptions()) : PolyglotLocalizerOptions<ZonedYearLocalizer>

Localization options for ZonedYearLocalizer.

Functions

Link copied to clipboard
fun Zoned<Instant>.localize(options: ZonedInstantOptions = ZonedInstantOptions(), locale: PlatformLocale = getDefaultLocale()): String

Localizes this Instant at this TimeZone with the given options in the given locale.

fun Zoned<LocalDate>.localize(options: ZonedDateOptions = ZonedDateOptions(), locale: PlatformLocale = getDefaultLocale()): String
fun LocalDate.localize(options: DateStyleOptions = Defaults.DATE, locale: PlatformLocale = getDefaultLocale()): String

Localizes this LocalDate with the given options in the given locale.

fun Zoned<YearMonth>.localize(options: ZonedYearMonthOptions = ZonedYearMonthOptions(), locale: PlatformLocale = getDefaultLocale()): String
fun YearMonth.localize(options: YearMonthOptions = YearMonthOptions(), locale: PlatformLocale = getDefaultLocale()): String

Localizes this YearMonth with the given options in the given locale.

fun Duration.localize(options: DurationOptions = DurationOptions(), locale: PlatformLocale = getDefaultLocale()): String

Localizes this Duration with the given options in the given locale.

fun LocalDateTime.localize(options: LocalDateTimeOptions = LocalDateTimeOptions(), locale: PlatformLocale = getDefaultLocale()): String

Localizes this LocalDateTime with the given options in the given locale.

fun LocalTime.localize(options: LocalTimeOptions<*> = LocalTimeOptions(Defaults.LOCAL_TIME), locale: PlatformLocale = getDefaultLocale()): String
fun LocalTime.localize(options: LocalTimeStyleOptions, locale: PlatformLocale = getDefaultLocale()): String

Localizes this LocalTime with the given options in the given locale.

Link copied to clipboard
fun Instant.localizeDiff(reference: Instant, options: TickingDurationOptions = TickingDurationOptions(), locale: PlatformLocale = getDefaultLocale()): TickingValue<String>

Calculates the diff between this Instant and reference, and localizes the result with the given options in the given locale.

Link copied to clipboard
fun Instant.localizeDiffAsFlow(options: TickingDurationOptions = TickingDurationOptions(), locale: PlatformLocale = getDefaultLocale(), clock: Flow<ClockWrapper> = SYSTEM_CLOCK): Flow<String>

Calculates the diff between this Instant and clock, and localizes the result with the given options in the given locale, returning a Flow that automatically receives new localizations as they are needed.

Link copied to clipboard
fun Instant.localizeDiffNow(options: TickingDurationOptions = TickingDurationOptions(), locale: PlatformLocale = getDefaultLocale(), clock: Clock = Clock.System): TickingValue<String>

Calculates the diff between this Instant and the current instant of clock, and localizes the result with the given options in the given locale.

Link copied to clipboard
fun Duration.localizeTicking(options: TickingDurationOptions = TickingDurationOptions(), locale: PlatformLocale = getDefaultLocale()): TickingValue<String>

Localizes this Duration with the given options in the given locale same as Duration.localize, but returns a TickingValue instead.