---
title: Locale.Components
framework: foundation
role: symbol
role_heading: Structure
path: foundation/locale/components
---

# Locale.Components

A type that represents the components of a locale, for use when creating a locale with specific overrides.

## Declaration

```swift
struct Components
```

## Overview

Overview Use Locale.Components with the init(components:) initializer to create a custom Locale that overrides specific traits of a default locale. When you create a locale with components, the locale uses any overridden values instead of defaults preferred by the region or language. Leave a property nil to accept the default value. The properties in this type correspond with those in Locale, which declares them as read-only rather than read-write. You use this type to customize components when creating a custom locale, and use Locale to examine the components of an existing locale. The following example creates a Locale.Components instance for US English, but then customizes its components. It sets the first day of the week to Monday and the hour cycle to zero-to-23. These components override the en-US defaults of Sunday and one-to-12, respectively. It then uses init(components:) to create a custom Locale. var components = Locale.Components(languageCode: "en", languageRegion: "US") components.firstDayOfWeek = Locale.Weekday.monday components.hourCycle = Locale.HourCycle.zeroToTwentyThree let locale = Locale(components: components)

## Topics

### Creating a locale components instance

- [init(identifier:)](foundation/locale/components/init(identifier:).md)
- [init(languageCode:script:languageRegion:)](foundation/locale/components/init(languagecode:script:languageregion:).md)
- [init(locale:)](foundation/locale/components/init(locale:).md)

### Specifying language components

- [languageComponents](foundation/locale/components/languagecomponents.md)
- [Locale.Language.Components](foundation/locale/language-swift.struct/components.md)

### Specifying date and time components

- [calendar](foundation/locale/components/calendar.md)
- [Calendar.Identifier](foundation/calendar/identifier-swift.enum.md)
- [firstDayOfWeek](foundation/locale/components/firstdayofweek.md)
- [Locale.Weekday](foundation/locale/weekday.md)
- [hourCycle](foundation/locale/components/hourcycle.md)
- [Locale.HourCycle](foundation/locale/hourcycle-swift.enum.md)
- [timeZone](foundation/locale/components/timezone.md)

### Specifiying measurement and counting components

- [currency](foundation/locale/components/currency.md)
- [Locale.Currency](foundation/locale/currency-swift.struct.md)
- [measurementSystem](foundation/locale/components/measurementsystem.md)
- [Locale.MeasurementSystem](foundation/locale/measurementsystem-swift.struct.md)
- [numberingSystem](foundation/locale/components/numberingsystem.md)
- [Locale.NumberingSystem](foundation/locale/numberingsystem-swift.struct.md)

### Specifying region components

- [region](foundation/locale/components/region.md)
- [Locale.Region](foundation/locale/region-swift.struct.md)
- [subdivision](foundation/locale/components/subdivision.md)
- [Locale.Subdivision](foundation/locale/subdivision-swift.struct.md)
- [variant](foundation/locale/components/variant.md)
- [Locale.Variant](foundation/locale/variant-swift.struct.md)

### Specifying ordering components

- [collation](foundation/locale/components/collation.md)
- [Locale.Collation](foundation/locale/collation-swift.struct.md)

## Relationships

### Conforms To

- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Creating a locale by components

- [init(components:)](foundation/locale/init(components:).md)
- [init(languageCode:script:languageRegion:)](foundation/locale/init(languagecode:script:languageregion:).md)
- [init(languageComponents:)](foundation/locale/init(languagecomponents:).md)
- [Locale.Language.Components](foundation/locale/language-swift.struct/components.md)
