YRTI18nManager
class YRTI18nManager : NSObject |
Localization manager.
Summary
Instance methods
func localizeDistance(withDistance distance: Int) -> String |
func localizeDuration(withDuration duration: Int) -> String |
func localizeSpeed(withSpeed speed: Double) -> String |
func localizeDataSize(withDataSize dataSize: Int64) -> String |
func canonicalSpeed(withSpeed speed: Double) -> YRTCanonicalUnit |
func localizeCanonicalUnit(with canonicalUnit: YRTCanonicalUnit) -> String |
Properties
var prefs: YRTI18nPrefs { get set } |
var som: YRTSystemOfMeasurement { get set } |
var timeFormat: YRTTimeFormat { get set } |
var isValid: Bool { get } |
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.