LocaleContainer Class Reference
Inherits from | NSObject |
Declared in | LocaleContainer.h |
Overview
LocaleContainer contains a NSLocale instance and a BCP 47 tag string.
LocaleContainer is used to set (/get) locale to (/from) KiiUser instance.
See [KiiUser locale] and [KiiUserFields locale].
You may need to only work with [LocaleContainer locale] property in most cases.
[LocaleContainer localeString] is for keeping the original string received from
Kii Cloud.
NSLocale may convert the tag to different shape if the tag is generated by other
devices. (Android, Unity, JS, etc.).
For instance, “az-latn-az” from server, after converted to NSLocale, the localeString
will become “az-az”. In this case, “az-latn-az” will be stored in
[LocaleContainer localeString] and you can check the value If you need to get it.
Properties
Instance Methods
init
Init LocaleContainer with [NSLocale currentLocale]
- (id)init
Discussion
Init LocaleContainer with [NSLocale currentLocale]
[LocaleContainer locale] property is initilized with [NSLocale currentLocale]. Initializer substutute [LocaleContainer localeString] with the string obtained by [NSLocale localeIdentifer].
Declared In
LocaleContainer.h
initWithBcp47Tag:
Init LocaleContainer with BCP 47 format tag
- (id)initWithBcp47Tag:(NSString *)bcp47tag
Parameters
- bcp47tag
BCP 47 format tag
Discussion
Init LocaleContainer with BCP 47 format tag
You may use [LocaleContainer init] in most cases. Kii Cloud SDK uses this initializer when retrieved user’s locale from server. Initializer substutute [LocaleContainer locale] with NSLocale instance converted through [NSLocale initWithLocaleIdentifier:]
Declared In
LocaleContainer.h
initWithLocale:
Init LocaleContainer with NSLocale instance
- (id)initWithLocale:(NSLocale *)locale
Parameters
- locale
NSLocale instance.
Discussion
Init LocaleContainer with NSLocale instance
You may use [LocaleContainer init] in most cases. You use it when need to set other locale than [NSLocale currentLocale]. Initializer substutute [LocaleContainer localeString] with the string obtained by [NSLocale localeIdentifer].
Declared In
LocaleContainer.h