Title: Theory / Important / CS / Programming / Objective-C / Library / NS / Locale
On every note of this deck, unless a note says otherwise:
Page: https://developer.apple.com/documentation/foundation/nslocale?language=objc
Language: Objective-C
Page: https://developer.apple.com/documentation/foundation/nslocale?language=objc
Page: https://developer.apple.com/documentation/foundation/nslocale?language=objc

Typ: NSLocale
Meaning: Information about linguistic, cultural, and technological conventions for use in formatting data for presentation.
Page: https://developer.apple.com/documentation/foundation/nslocale?language=objc
Language: Objective-C

Instruction: [NSLocale
  localeWithLocaleIdentifier:ident
]
Returns: a locale initialized using the given locale identifier.
Typ: NSLocale

Instruction: [NSLocale
  canonicalLocaleIdentifierFromString:string
]
Returns: The canonical identifier for a given locale identification string.

Instruction: [NSLocale
  componentsFromLocaleIdentifier:string
]
Returns: a dictionary that is the result of parsing a locale ID.

Instruction: [NSLocale
  localeIdentifierFromComponents:dict
]
Returns: A locale identifier from the components specified in a given dictionary.

Instruction: [NSLocale
  canonicalLanguageIdentifierFromString:string
]
Returns: A canonical language identifier by mapping an arbitrary locale identification string to the canonical identifier.

Instruction: [NSLocale
  localeIdentifierFromWindowsLocaleCode:lcid
]
Returns: a locale identifier from a Windows locale code.

Instruction: [NSLocale
  windowsLocaleCodeFromLocaleIdentifier:localeIdentifier
]
Returns: A Window locale code from the locale identifier.

Instruction: [NSLocale
  characterDirectionForLanguage:isoLangCode
]
Returns: the direction of the sequence of characters in a line for the specified ISO language code.
Typ: NSLocaleLanguageDirection

Instruction: [NSLocale
  lineDirectionForLanguage:isoLangCode
]
Returns: the direction of the sequence of lines for the specified ISO language code.

Instruction: [NSLocale
  displayNameForKey:key
  value:value
]
Returns: the display name for the given locale component value.

Instruction: [NSLocale
  objectForKey:key
]
Returns: The value of the component corresponding to the specified key.
Variables: NSlocaleKey key

Instruction: [locale
  localizedStringForCalendarIdentifier:calendarIdentifier
]
Returns: the localized string for the specified calendar identifier.
Variables: NSLocale locale
Example: For example, on an American English (en_US) locale, passing NSCalendarIdentifierGregorian as the identifier, produces the string "Gregorian Calendar".

Instruction: [locale
  localizedStringForCurrencyCode:currencyCode
]
Returns: the localized string for the specified currency code.
Variables: NSLocale locale
Extra: This method is equivalent to calling the displayNameForKey:value: method passing the NSLocaleCurrencyCode key and currencyCode value.
Example: Calling this method on an American English (en_US) locale, passing "JPY" for currencyCode, produces the string "Japanese Yen".

Instruction: [locale
  localizedStringForCollatorIdentifier:collatorIdentifier
]
Returns: The localized string for the specified collator identifier.
Variables: NSLocale locale
Extra: This method is equivalent to calling the displayNameForKey:value: method passing the NSLocaleCollatorIdentifier key and collatorIdentifier value.

Instruction: [locale
  localizedStringForCollationIdentifier:collationIdentifier
]
Returns: the localized string for the specified collation identifier.
Variables: NSLocale locale
Extra: equivalent to calling the displayNameForKey:value: method passing the NSLocaleCollationIdentifier key and collationIdentifier value.
Example: calling this method on an American English (en_US) locale, passing "phonebook" for collationIdentifier, produces the string "Phonebook Sort Order".

Instruction: [locale
  localizedStringForVariantCode:variantCode
]
Returns: the localized string for the specified variant code
Variables: NSLocale locale
Extra: This method is equivalent to calling the displayNameForKey:value: method passing the NSLocaleVariantCode key and variantCode value.
Example: calling this method on an American English (en_US) locale, passing "POSIX" for variantCode, produces the string "Computer".

Instruction: [locale
  localizedStringForScriptCode:scriptCode
]
Returns: the localized string for the specified script code.
Variables: NSLocale locale
Extra: This method is equivalent to calling the displayNameForKey:value: method passing the NSLocaleScriptCode key and scriptCode value.
Example: calling this method on an American English (en_US) locale, passing "Hant" for scriptCode, produces the string "Traditional Han".

Instruction: [locale
  localizedStringForLanguageCode:languageCode
]
Returns: The localized name of the language.
Variables: NSLocale locale
Extra: This method is equivalent to calling the displayNameForKey:value: method passing the NSLocaleLanguageCode key and languageCode value.
Example: calling this method on an American English (en_US) locale, passing "zh" for languageCode, produces the string "Chinese".

Instruction: [locale
  localizedStringForCountryCode:countryCode
]
Returns: The localized name of the country or region.
Variables: NSLocale locale
Extra: This method is equivalent to calling the displayNameForKey:value: method passing the NSLocaleCountryCode key and countryCode value.
Example: calling this method on an American English (en_US) locale, passing "GB" for countryCode, produces the string "United Kingdom".

Instruction: [locale
  localizedStringForLocaleIdentifier:localeIdentifier
]
Returns: The localized name of the locale.
Variables: NSLocale locale
Extra: This method is equivalent to calling the displayNameForKey:value: method passing the NSLocaleIdentifier key and localeIdentifier value.
Example: calling this method on an American English (en_US) locale, passing "fr_FR" for localeIdentifier, produces the string "French (France)".

Instruction: [locale
  initWithCoder:coder
]
Returns: a locale initialized from data in the given unarchiver.
Variables: NSLocale locale

Instruction: [locale
  initWithLocaleIdentifier:string
]
Effect: Initializes a locale using a given locale identifier.
Variables: NSLocale locale

Constant: NSCurrentLocaleDidChangeNotification
Meaning: A notification that indicates that the user’s locale changed.
Language: Objective-C

Constant: NSCurrentLocaleDidChangeNotification
Meaning: The list of known country or region codes.
Language: Objective-C
Typ: NSArray<NSString *>

Constant: ISOLanguageCodes
Meaning: The list of known language codes.
Language: Objective-C
Typ: NSArray<NSString *>

Constant: ISOCurrencyCodes
Meaning: The list of known currency codes.
Language: Objective-C
Typ: NSArray<NSString *>

Typ: NSLocaleKey
Meaning: The keys used to access components of a locale.
Page: https://developer.apple.com/documentation/foundation/nslocale?language=objc
Language: Objective-C
Implementation: NSString

Typ: NSLocaleLanguageDirection
TypMeaning: The directions that a language may take across a page of text.
Page: https://developer.apple.com/documentation/foundation/nslocale?language=objc
Language: Objective-C
Value: NSLocaleLanguageDirectionUnknown
The direction of the language is unknown.
Value2: NSLocaleLanguageDirectionLeftToRight
The language direction is from left to right.
NSLocaleLanguageDirectionRightToLeft
The language direction is from right to left.
NSLocaleLanguageDirectionTopToBottom
The language direction is from top to bottom.
NSLocaleLanguageDirectionBottomToTop
The language direction is from bottom to top.

Constant: NSLocale.preferredLanguages
Meaning: An ordered list of the user's preferred languages.
Language: Objective-C

Variable: locale.alternateQuotationEndDelimiter
Meaning: The alternate end quotation symbol for the locale.
Language: Objective-C
Variables: NSLocale locale
Extra: This property contains the same value returned by the objectForKey: method when passing the NSLocaleAlternateQuotationEndDelimiterKey key.
Example: "’", "›", and "』".

Variable: locale.alternateQuotationBeginDelimiter
Meaning: The alternate begin quotation symbol for the locale.
Language: Objective-C
Variables: NSLocale locale
Extra: This property contains the same value returned by the objectForKey: method when passing the NSLocaleAlternateQuotationBeginDelimiterKey key.
Example: "‘", "‹", and "『".

Variable: locale.quotationEndDelimiter
Meaning: The end quotation symbol for the locale.
Language: Objective-C
Variables: NSLocale locale
Extra: This property contains the same value returned by the objectForKey: method when passing the NSLocaleQuotationEndDelimiterKey key.
Example: "”", "“", "»", and "」".

Variable: locale.quotationBegin
Meaning: The begin quotation symbol for the locale.
Language: Objective-C
Variables: NSLocale locale
Extra: This property contains the same value returned by the objectForKey: method when passing the NSLocaleQuotationBeginDelimiterKey key.
Example: "“", "„", "«", and "「".

Variable: locale.calendarIdentifier
Meaning: The calendar identifier for the locale.
Language: Objective-C
Variables: NSLocale locale
Extra: Use localizedStringForCalendarIdentifier: to obtain a version of the value suitable for display to the user.

Variable: locale.currencySymbol
Meaning: The currency symbol for the locale
Language: Objective-C
Variables: NSLocale locale
Extra: This property contains the same value returned by the objectForKey: method when passing the NSLocaleCurrencySymbol key.
Example: "$", "€", and "¥".

Variable: locale.currencyCode
Meaning: The currency code for the locale.
Language: Objective-C
Variables: NSLocale locale
Extra: Use localizedStringForCurrencyCode: to obtain a version of the value suitable for display to the user.
This property contains the same value returned by the objectForKey: method when passing the NSLocaleCurrencyCode key.
Example: "USD", "EUR", and "JPY".

Variable: locale.groupingSeparator
Meaning: The grouping separator for the locale.
Language: Objective-C
Variables: NSLocale locale
Extra: This property contains the same value returned by the objectForKey: method when passing the NSLocaleGroupingSeparator key.
Example: ," and " ".

Variable: locale.decimalSeparator
Meaning: decimal separator for the locale.
Language: Objective-C
Variables: NSLocale locale
Extra: This property contains the same value returned by the objectForKey: method when passing the NSLocaleDecimalSeparator key.
Example: "." and ",".

Variable: locale.usesMetricSystem
Meaning: whether the locale uses the metric system.
Language: Objective-C
Variables: NSLocale locale
Extra: This property contains the same value returned by the objectForKey: method when passing the NSLocaleUsesMetricSystem key.

Variable: locale.collatorIdentifier
Meaning: The collator identifier for the locale.
Language: Objective-C
Variables: NSLocale locale
Extra: Use localizedStringForCollatorIdentifier: to obtain a version of the value suitable for display to the user.
This property contains the same value returned by the objectForKey: method when passing the NSLocaleCollatorIdentifier key.
Example: "en"

Variable: locale.collationIdentifier
Language: Objective-C
Variables: NSLocale locale
Extra: Use localizedStringForCollationIdentifier: to obtain a version of the value suitable for display to the user.
This property contains the same value returned by the objectForKey: method when passing the NSLocaleCollationIdentifier key.
Example: "phonebook" and "pinyin".

Variable: locale.exemplarCharacterSet
Meaning: The exemplar character set for the locale.
Language: Objective-C
Variables: NSLocale locale
Extra: This property contains the same value returned by the objectForKey: method when passing the NSLocaleExemplarCharacterSet key.

Variable: locale.variantCode
Meaning: variant code for the locale.
Language: Objective-C
Variables: NSLocale locale
Extra: Use localizedStringForVariantCode: to obtain a version of the value suitable for display to the user.
This property contains the same value returned by the objectForKey: method when passing the NSLocaleVariantCode key.
Example: "POSIX" and "PREEURO".

Variable: locale.scriptCode
Meaning: The script code for the locale.
Language: Objective-C
Variables: NSLocale locale
Extra: Use localizedStringForScriptCode: to obtain a version of the value suitable for display to the user.
This property contains the same value returned by the objectForKey: method when passing the NSLocaleScriptCode key.
Example: "Latn" and "Hant".

Variable: locale.languageCode
Meaning: The language code for the locale.
Language: Objective-C
Variables: NSLocale locale
Extra: Use localizedStringForLanguageCode: to obtain a version of the value suitable for display to the user.
This property contains the same value returned by the objectForKey: method when passing the NSLocaleLanguageCode key.
Example: "en", "es", and "zh".

Variable: locale.countryCode
Meaning: The country or region code for the locale.
Language: Objective-C
Variables: NSLocale locale
Extra: Use localizedStringForCountryCode: to obtain a version of the value suitable for display to the user.
This property contains the same value returned by the objectForKey: method when passing the NSLocaleCountryCode key.
Example: "GB", "FR", and "HK".

Variable: locale.localeIdentifier
Meaning: identifier for the locale.
Language: Objective-C
Variables: NSLocale locale
Extra: Use localizedString(forIdentifier:) to obtain a version of the value suitable for display to the user.
Note
The value held in the property may differ from the identifier used to initialize the locale because NSLocale may canonicalize it during initialization.
This property contains the same value returned by the objectForKey: method when passing the NSLocaleIdentifier key.
Example: "en_GB", "es_ES_PREEURO", and "zh-Hant_HK_POSIX@collation=pinyin;currency=CNY".

Constant: NSlocale.commonISOCurrencyCodes
Meaning: A list of commonly encountered currency codes.
Language: Objective-C
Typ: NSArray<NSString *> *

Constant: NSLocale.availableLocaleIdentifiers
Meaning: The list of locale identifiers available on the system.
Language: Objective-C
Extra: A locale identifier starts with a language code, often includes a region code, and occasionally includes a script designator. See Locale IDs for more information about the structure of a locale identifier.
Use localizedStringForLocaleIdentifier: to obtain a human readable description of any of the locale identifiers in this list.
Typ: NSArray<NSString *> *

Constant: NSLocale.systemLocale
Meaning: A locale representing the generic root values with little localization.
Language: Objective-C
Typ: NSLocale

Constant: NSLocale.currentLocale
Meaning: A locale representing the user's region settings at the time the property is read.
Language: Objective-C
Extra: The locale is formed from the settings for the current user’s chosen system locale overlaid with any custom settings the user has specified.
Use this property when you need to rely on a consistent locale. A locale instance obtained this way does not change even when the user changes region settings. If you want a locale instance that always reflects the current configuration, use the one provided by the autoupdatingCurrentLocale property instead.
To receive notification of locale changes, add your object as an observer of the a NSCurrentLocaleDidChangeNotification.
Typ: NSLocale

Constant: NSLocale.autoupdatingCurrentLocale
Meaning: A locale which tracks the user’s current preferences.
Language: Objective-C
Extra: The locale is formed from the settings for the current user’s chosen system locale overlaid with any custom settings the user has specified.
Use this property when you want a locale that always reflects the latest configuration settings. When the user changes settings, a locale instance obtained from this property alters its behavior to match. If you need to rely on a locale that does not change, use the locale given by the currentLocale property instead.
Although the locale obtained here automatically follows the latest region settings, it provides no indication when the settings change. To receive notification of locale changes, add your object as an observer of NSCurrentLocaleDidChangeNotification.
Typ: NSLocale