<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSLocale/localeIdentifier",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSLocale(py)localeIdentifier"
  },
  "title" : "localeIdentifier"
}
-->

# localeIdentifier

The identifier for the locale.

```
var localeIdentifier: String { get }
```

## Discussion

Examples of locale identifiers include `"en_GB"`, `"es_ES_PREEURO"`, and `"zh-Hant_HK_POSIX@collation=pinyin;currency=CNY"`.

Use [`localizedString(forIdentifier:)`](/documentation/Foundation/Locale/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 ``doc://com.apple.foundation/documentation/Foundation/NSLocale`` may canonicalize it during initialization.

This property contains the same value returned by the [`object(forKey:)`](/documentation/Foundation/NSLocale/object(forKey:)) method when passing the [`identifier`](/documentation/Foundation/NSLocale/Key/identifier) key.

## See Also

[`availableLocaleIdentifiers`](/documentation/Foundation/NSLocale/availableLocaleIdentifiers)

The list of locale identifiers available on the system.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)