localeIdentifier(fromComponents:)
Returns a locale identifier from the components specified in a given dictionary.
Declaration
class func localeIdentifier(fromComponents dict: [String : String]) -> StringParameters
- 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.
Discussion
This reverses the actions of components(fromLocaleIdentifier:), so for example the dictionary {NSLocaleLanguageCode="en", NSLocaleCountryCode="US", NSLocaleCalendar=NSJapaneseCalendar} becomes "en_US@calendar=japanese".