Package world.mappable.runtime.i18n

Interface I18nManager

interface I18nManager

Localization manager.

Summary

Methods

Type and modifiers

Method and Description

java.lang.String

localizeDistance(int distance)
Converts a distance value to the current locale.

java.lang.String

localizeDuration(int duration)
Converts a duration to the current locale.

java.lang.String

localizeSpeed(double speed)
Converts speed to the current locale.

java.lang.String

localizeDataSize(long dataSize)
Converts data size to the current locale.

CanonicalUnit

canonicalSpeed(double speed)
Represents the speed with the value and unit of measurement separated.

java.lang.String

localizeCanonicalUnit(@NonNull CanonicalUnit canonicalUnit)
Localizes a value represented by canonical units.

I18nPrefs

getPrefs()
Localization preferences.

void

setPrefs(@NonNull I18nPrefs prefs)

SystemOfMeasurement

getSom()
System of measurement used.

void

setSom(@NonNull SystemOfMeasurement som)

TimeFormat

getTimeFormat()
Preferred time format.

void

setTimeFormat(@NonNull TimeFormat timeFormat)

boolean

isValid()
Tells if this I18nManager is valid or not.

Methods

localizeDistance

@NonNull
java.lang.String localizeDistance(int distance)

Converts a distance value to the current locale.


localizeDuration

@NonNull
java.lang.String localizeDuration(int duration)

Converts a duration to the current locale.


localizeSpeed

@NonNull
java.lang.String localizeSpeed(double speed)

Converts speed to the current locale.


localizeDataSize

@NonNull
java.lang.String localizeDataSize(long dataSize)

Converts data size to the current locale.


canonicalSpeed

@NonNull
CanonicalUnit canonicalSpeed(double speed)

Represents the speed with the value and unit of measurement separated.


localizeCanonicalUnit

@NonNull
java.lang.String localizeCanonicalUnit(@NonNull CanonicalUnit canonicalUnit)

Localizes a value represented by canonical units.


getPrefs

@NonNull
I18nPrefs getPrefs()

Localization preferences.


setPrefs

void setPrefs(@NonNull I18nPrefs prefs)


getSom

@NonNull
SystemOfMeasurement getSom()

System of measurement used.


setSom

void setSom(@NonNull SystemOfMeasurement som)


getTimeFormat

@NonNull
TimeFormat getTimeFormat()

Preferred time format.


setTimeFormat

void setTimeFormat(@NonNull TimeFormat timeFormat)


isValid

boolean isValid()

Tells if this I18nManager is valid or not.

Any other method (except for this one) called on an invalid I18nManager will throw java.lang.RuntimeException. An instance becomes invalid only on UI thread, and only when its implementation depends on objects already destroyed by now. Please refer to general docs about the interface for details on its invalidation.