Interface I18nManager

com.yandex.runtime.i18n

public interface I18nManager

Localization manager.

Methods

CanonicalUnit canonicalSpeed(double speed)

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

I18nPrefs getPrefs()

Localization preferences.

SystemOfMeasurement getSom()

System of measurement used.

TimeFormat getTimeFormat()

Preferred time format.

boolean isValid()

Tells if this I18nManager is valid or no.

String localizeCanonicalUnit(@NonNull CanonicalUnit canonicalUnit)

Localizes a value represented by canonical units.

String localizeDataSize(long dataSize)

Converts data size to the current locale.

String localizeDistance(int distance)

Converts a distance value to the current locale.

String localizeDuration(int duration)

Converts a duration to the current locale.

String localizeSpeed(double speed)

Converts speed to the current locale.

void setPrefs(@NonNull I18nPrefs prefs)
void setSom(@NonNull SystemOfMeasurement som)
void setTimeFormat(@NonNull TimeFormat timeFormat)

Method Detail

canonicalSpeed

public CanonicalUnit canonicalSpeed (double speed)

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

getPrefs

public I18nPrefs getPrefs ()

Localization preferences.

getSom

public SystemOfMeasurement getSom ()

System of measurement used.

getTimeFormat

public TimeFormat getTimeFormat ()

Preferred time format.

isValid

public boolean isValid ()

Tells if this I18nManager is valid or no.

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.

localizeCanonicalUnit

public String localizeCanonicalUnit (@NonNull CanonicalUnit canonicalUnit)

Localizes a value represented by canonical units.

localizeDataSize

public String localizeDataSize (long dataSize)

Converts data size to the current locale.

localizeDistance

public String localizeDistance (int distance)

Converts a distance value to the current locale.

localizeDuration

public String localizeDuration (int duration)

Converts a duration to the current locale.

localizeSpeed

public String localizeSpeed (double speed)

Converts speed to the current locale.

setPrefs

public void setPrefs (@NonNull I18nPrefs prefs)

setSom

public void setSom (@NonNull SystemOfMeasurement som)

setTimeFormat

public void setTimeFormat (@NonNull TimeFormat timeFormat)