Type Method


Returns a locale identifier from the components specified in a given dictionary.


+ (NSString *)localeIdentifierFromComponents:(NSDictionary<NSString *,NSString *> *)dict;



A dictionary containing components that specify a locale. For possible values, see NSLocale Component Keys.

Return Value

A locale identifier created from the components specified in dict.


This reverses the actions of componentsFromLocaleIdentifier:, so for example the dictionary {NSLocaleLanguageCode="en", NSLocaleCountryCode="US", NSLocaleCalendar=NSJapaneseCalendar} becomes "en_US@calendar=japanese".

See Also

Converting Between Identifiers

+ canonicalLocaleIdentifierFromString:

Returns the canonical identifier for a given locale identification string.

+ componentsFromLocaleIdentifier:

Returns a dictionary that is the result of parsing a locale ID.

+ canonicalLanguageIdentifierFromString:

Returns a canonical language identifier by mapping an arbitrary locale identification string to the canonical identifier.

+ localeIdentifierFromWindowsLocaleCode:

Returns a locale identifier from a Windows locale code.

+ windowsLocaleCodeFromLocaleIdentifier:

Returns a Window locale code from the locale identifier.