MRTI18nManager

class MRTI18nManager : 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) -> MRTCanonicalUnit
Represents the speed with the value and unit of measurement separated

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

Properties

var prefsMRTI18nPrefs { get set }
Localization preferences

var somMRTSystemOfMeasurement { get set }
System of measurement used

var timeFormatMRTTimeFormat { 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) -> MRTCanonicalUnit

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


localizeCanonicalUnit(with:)

func localizeCanonicalUnit(with canonicalUnit: MRTCanonicalUnit) -> String

Localizes a value represented by canonical units.


Properties

prefs

var prefs: MRTI18nPrefs { get set }

Localization preferences.


som

var som: MRTSystemOfMeasurement { get set }

System of measurement used.


timeFormat

var timeFormat: MRTTimeFormat { 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.