YRTI18nManager

@interface YRTI18nManager : NSObject

Localization manager.

Summary

Instance methods

- (nonnull NSString *)localizeDistanceWithDistance:(NSInteger)distance;
Converts a distance value to the current locale

- (nonnull NSString *)localizeDurationWithDuration:(NSInteger)duration;
Converts a duration to the current locale

- (nonnull NSString *)localizeSpeedWithSpeed:(double)speed;
Converts speed to the current locale

- (nonnull NSString *)localizeDataSizeWithDataSize:(long long)dataSize;
Converts data size to the current locale

- (nonnull YRTCanonicalUnit *)canonicalSpeedWithSpeed:(double)speed;
Represents the speed with the value and unit of measurement separated

- (nonnull NSString *)localizeCanonicalUnitWithCanonicalUnit:
    (nonnull YRTCanonicalUnit *)canonicalUnit;

Localizes a value represented by canonical units

Properties

@property (nonatomic, assign, unsafe_unretained, readwrite, nonnull)
    YRTI18nPrefs *prefs;

Localization preferences

@property (nonatomic, assign, unsafe_unretained, readwrite)
    YRTSystemOfMeasurement som;

System of measurement used

@property (nonatomic, assign, unsafe_unretained, readwrite)
    YRTTimeFormat timeFormat;

Preferred time format

@property (nonatomic, readonly, getter=isValid) BOOL valid;
Tells if this object is valid or no

Instance methods

localizeDistanceWithDistance:

- (nonnull NSString *)localizeDistanceWithDistance:(NSInteger)distance;

Converts a distance value to the current locale.


localizeDurationWithDuration:

- (nonnull NSString *)localizeDurationWithDuration:(NSInteger)duration;

Converts a duration to the current locale.


localizeSpeedWithSpeed:

- (nonnull NSString *)localizeSpeedWithSpeed:(double)speed;

Converts speed to the current locale.


localizeDataSizeWithDataSize:

- (nonnull NSString *)localizeDataSizeWithDataSize:(long long)dataSize;

Converts data size to the current locale.


canonicalSpeedWithSpeed:

- (nonnull YRTCanonicalUnit *)canonicalSpeedWithSpeed:(double)speed;

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


localizeCanonicalUnitWithCanonicalUnit:

- (nonnull NSString *)localizeCanonicalUnitWithCanonicalUnit:
    (nonnull YRTCanonicalUnit *)canonicalUnit;

Localizes a value represented by canonical units.


Properties

prefs

@property (nonatomic, assign, unsafe_unretained, readwrite, nonnull)
    YRTI18nPrefs *prefs;

Localization preferences.


som

@property (nonatomic, assign, unsafe_unretained, readwrite)
    YRTSystemOfMeasurement som;

System of measurement used.


timeFormat

@property (nonatomic, assign, unsafe_unretained, readwrite)
    YRTTimeFormat timeFormat;

Preferred time format.


valid

@property (nonatomic, readonly, getter=isValid) BOOL valid;

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.