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

# languageCode

The language code for the locale.

```
var languageCode: String { get }
```

## Discussion

Examples of language codes include `"en"`, `"es"`, and `"zh"`.

Use [`localizedString(forLanguageCode:)`](/documentation/Foundation/NSLocale/localizedString(forLanguageCode:)) to obtain a version of the value suitable for display to the user.

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

## See Also

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

The list of known language codes.



---

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)