SITMultilanguageString Class Reference

Inherits from NSObject
Declared in SITMultilanguageString.h

Overview

A string with a different value depending of the language. It’s recommended to support a default value {@link #defaultValue()} (optional) for non supported languages.

ISO 639-2 is used to identify the languages.

– value

Obtain the value corresponding to the default locale.

- (NSString *)value

Return Value

An string containing the value of the string for the default locale.

Declared In

SITMultilanguageString.h

– valueForLocale:

Obtain the value corresponding to the selected locale.

- (NSString *)valueForLocale:(NSLocale *)locale

Parameters

locale

A valid NSLocale object to be used to obtain the string value.

Return Value

An string containing the value of the string for the selected locale.

Declared In

SITMultilanguageString.h

– defaultLocale

Get the locale set as default. (Only english and spanish supported as default)

- (NSLocale *)defaultLocale

Return Value

A locale representing the default locale selected.

Declared In

SITMultilanguageString.h

– locales

Get the locales contained in this object.

- (NSArray *)locales

Return Value

An array containing all avaliable locales for the string.

Declared In

SITMultilanguageString.h

– initWithDefaultLocale:

This method initializes the object and sets the default locale for the localized string. Right now only english and spanish are supported. If a different locale is passed to this method, english will be set as default.

- (instancetype)initWithDefaultLocale:(NSLocale *)defaultLocale

Parameters

defaultLocale

A valid NSLocale object to be set as the default locale. (Only english and spanish supported as default)

Return Value

Initialized instance of SITMultilanguageString with the default locale set.

Declared In

SITMultilanguageString.h

– initWithValue:defaultLocale:

This method initializes the object and sets the default value and locale for the localized string. Right now only english and spanish are supported. If a different locale is passed to this method, english will be set as default.

- (instancetype)initWithValue:(NSString *)value defaultLocale:(NSLocale *)defaultLocale

Parameters

value

String with the value associated to the selected default locale.

defaultLocale

A valid NSLocale object to be set as the default locale. (Only english and spanish supported as default)

Return Value

Initialized instance of SITMultilanguageString with the default locale set.

Declared In

SITMultilanguageString.h

– setDefaultLocale:

This method sets the default locale for the localized string. Right now only english and spanish are supported. If a different locale is passed to this method, english will be set as default.

- (void)setDefaultLocale:(NSLocale *)locale

Parameters

locale

A valid NSLocale object to be set as the default locale. (Only english and spanish supported as default)

Declared In

SITMultilanguageString.h

– setValue:forLocale:

This method sets a new value and locale for the localized string. Right now only english and spanish are supported. If a different locale is passed to this method, english will be set as default.

- (void)setValue:(NSString *)string forLocale:(NSLocale *)locale

Parameters

string

String with the value associated to the selected locale.

locale

A valid NSLocale object to be set with the associated string.

Declared In

SITMultilanguageString.h