---
title: languageCode
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/locale/languagecode-swift.property
---

# languageCode

The language code of the locale, or nil if has none.

## Declaration

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

## Discussion

Discussion For example, for the locale “zh-Hant-HK”, returns “zh”.

## See Also

### Getting information about a locale

- [identifier](foundation/locale/identifier.md)
- [identifier(_:)](foundation/locale/identifier(_:).md)
- [Locale.IdentifierType](foundation/locale/identifiertype.md)
- [calendar](foundation/locale/calendar.md)
- [regionCode](foundation/locale/regioncode.md)
- [scriptCode](foundation/locale/scriptcode.md)
- [variantCode](foundation/locale/variantcode.md)
- [exemplarCharacterSet](foundation/locale/exemplarcharacterset.md)
- [collationIdentifier](foundation/locale/collationidentifier.md)
- [collatorIdentifier](foundation/locale/collatoridentifier.md)
- [usesMetricSystem](foundation/locale/usesmetricsystem.md)
- [decimalSeparator](foundation/locale/decimalseparator.md)
- [groupingSeparator](foundation/locale/groupingseparator.md)
- [currencyCode](foundation/locale/currencycode.md)
- [currencySymbol](foundation/locale/currencysymbol.md)
