<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/Locale/Language-swift.struct/Components",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation6LocaleV8LanguageV10ComponentsV"
  },
  "title" : "Locale.Language.Components"
}
-->

# Locale.Language.Components

A type that identifies a language by its various components.

```
struct Components
```

## Topics

### Creating a language components instance

[`init(identifier: String)`](/documentation/Foundation/Locale/Language-swift.struct/Components/init(identifier:))

Creates a language components instance from a language identifier.

[`init(language: Locale.Language)`](/documentation/Foundation/Locale/Language-swift.struct/Components/init(language:))

Creates a language components instance from an existing language instance.

[`init(languageCode: Locale.LanguageCode?, script: Locale.Script?, region: Locale.Region?)`](/documentation/Foundation/Locale/Language-swift.struct/Components/init(languageCode:script:region:))

Creates a language components instance from a given language code, script, and region.

### Examining language component properties

[`var languageCode: Locale.LanguageCode?`](/documentation/Foundation/Locale/Language-swift.struct/Components/languageCode)

The language code that identifies this language.

[`struct LanguageCode`](/documentation/Foundation/Locale/LanguageCode-swift.struct)

An alphabetical code associated with a language.

[`var region: Locale.Region?`](/documentation/Foundation/Locale/Language-swift.struct/Components/region)

The region used with this language.

[`struct Region`](/documentation/Foundation/Locale/Region-swift.struct)

A type that represents a geographic region, for use in specifying a locale or language.

[`var script: Locale.Script?`](/documentation/Foundation/Locale/Language-swift.struct/Components/script)

The written script used by this language.

[`struct Script`](/documentation/Foundation/Locale/Script)

The written script used with a given language.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`Encodable`](/documentation/Swift/Encodable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Decodable`](/documentation/Swift/Decodable)

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

---

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)