---
title: localeIdentifier
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nslocale/localeidentifier
---

# localeIdentifier

The identifier for the locale.

## Declaration

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

## Discussion

Discussion Examples of locale identifiers include "en_GB", "es_ES_PREEURO", and "zh-Hant_HK_POSIX@collation=pinyin;currency=CNY". 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 object(forKey:) method when passing the identifier key.

## See Also

### Related Documentation

- [availableLocaleIdentifiers](foundation/nslocale/availablelocaleidentifiers.md)

### Getting Information About a Locale

- [countryCode](foundation/nslocale/countrycode.md)
- [languageCode](foundation/nslocale/languagecode.md)
- [scriptCode](foundation/nslocale/scriptcode.md)
- [variantCode](foundation/nslocale/variantcode.md)
- [exemplarCharacterSet](foundation/nslocale/exemplarcharacterset.md)
- [collationIdentifier](foundation/nslocale/collationidentifier.md)
- [collatorIdentifier](foundation/nslocale/collatoridentifier.md)
- [usesMetricSystem](foundation/nslocale/usesmetricsystem.md)
- [decimalSeparator](foundation/nslocale/decimalseparator.md)
- [groupingSeparator](foundation/nslocale/groupingseparator.md)
- [currencyCode](foundation/nslocale/currencycode.md)
- [currencySymbol](foundation/nslocale/currencysymbol.md)
- [calendarIdentifier](foundation/nslocale/calendaridentifier.md)
- [quotationBeginDelimiter](foundation/nslocale/quotationbegindelimiter.md)
- [quotationEndDelimiter](foundation/nslocale/quotationenddelimiter.md)
