YRTI18nManager

class YRTI18nManager : NSObject

Localization manager.

Summary

Instance methods

func localizeDistance(withDistance distance: Int) -> String
Converts a distance value to the current locale

func localizeDuration(withDuration duration: Int) -> String
Converts a duration to the current locale

func localizeSpeed(withSpeed speed: Double) -> String
Converts speed to the current locale

func localizeDataSize(withDataSize dataSize: Int64) -> String
Converts data size to the current locale

func canonicalSpeed(withSpeed speed: Double) -> YRTCanonicalUnit
Represents the speed with the value and unit of measurement separated

func localizeCanonicalUnit(with canonicalUnit: YRTCanonicalUnit) -> String
Localizes a value represented by canonical units

Properties

var prefsYRTI18nPrefs { get set }
Localization preferences

var somYRTSystemOfMeasurement { get set }
System of measurement used

var timeFormatYRTTimeFormat { get set }
Preferred time format

var isValid: Bool { get }
Tells if this object is valid or no

Instance methods

localizeDistance(withDistance:)

func localizeDistance(withDistance distance: Int) -> String

Converts a distance value to the current locale.


localizeDuration(withDuration:)

func localizeDuration(withDuration duration: Int) -> String

Converts a duration to the current locale.


localizeSpeed(withSpeed:)

func localizeSpeed(withSpeed speed: Double) -> String

Converts speed to the current locale.


localizeDataSize(withDataSize:)

func localizeDataSize(withDataSize dataSize: Int64) -> String

Converts data size to the current locale.


canonicalSpeed(withSpeed:)

func canonicalSpeed(withSpeed speed: Double) -> YRTCanonicalUnit

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


localizeCanonicalUnit(with:)

func localizeCanonicalUnit(with canonicalUnit: YRTCanonicalUnit) -> String

Localizes a value represented by canonical units.


Properties

prefs

var prefs: YRTI18nPrefs { get set }

Localization preferences.


som

var som: YRTSystemOfMeasurement { get set }

System of measurement used.


timeFormat

var timeFormat: YRTTimeFormat { get set }

Preferred time format.


isValid

var isValid: Bool { get }

Tells if this object is valid or no. Any method called on an invalid object will throw an exception. The object 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.


Предыдущая
Следующая