languageComponents
TypeScriptget languageComponents(): Locale_Language_ComponentsSwift declarationvar languageComponents: Locale.Language.ComponentsRepresents the language identifier a locale
struct · iOS 16.0+ · SDK 27.1
struct ComponentsA type that represents the components of a locale, for use when creating a locale with specific overrides.
get languageComponents(): Locale_Language_ComponentsSwift declarationvar languageComponents: Locale.Language.ComponentsRepresents the language identifier a locale
set languageComponents(value: Locale_Language_Components)Swift declarationvar languageComponents: Locale.Language.ComponentsRepresents the language identifier a locale
static initIdentifier(identifier: string): Locale_ComponentsSwift declarationinit(identifier: String)Creates a locale components instance with the specified identifier. - Parameter identifier: A BCP-47 language identifier such as `en-u-nu-thai-ca-buddhist` or an ICU-style identifier such as `en@calendar=buddhist;numbers=thai`.
get subdivision(): (Locale_Subdivision) | nullSwift declarationvar subdivision: Locale.Subdivision?Set this to override the regional subdivision of `region` Corresponds to the "sd" key of the Unicode BCP 47 extension
set subdivision(value: (Locale_Subdivision) | null)Swift declarationvar subdivision: Locale.Subdivision?Set this to override the regional subdivision of `region` Corresponds to the "sd" key of the Unicode BCP 47 extension
static initLanguageCodeScriptLanguageRegion(languageCode?: (Locale_LanguageCode) | null, script?: (Locale_Script) | null, languageRegion?: (Locale_Region) | null): Locale_ComponentsSwift declarationinit(languageCode: Locale.LanguageCode? = nil, script: Locale.Script? = nil, languageRegion: Locale.Region? = nil)Creates a `Locale.Components` with the specified language code, script and region for the language
get firstDayOfWeek(): (Locale_Weekday) | nullSwift declarationvar firstDayOfWeek: Locale.Weekday?Set this to override the first day of the week. To request the default first day of the week preferred by the locale, use `Locale.firstDayOfWeek` Corresponds to the "fw" key of the Unicode BCP 47 extension The preferred first day of the week that should be shown in a calendar view. Not necessarily the same as the first day after the weekend, and should not be determined from the weekend information
set firstDayOfWeek(value: (Locale_Weekday) | null)Swift declarationvar firstDayOfWeek: Locale.Weekday?Set this to override the first day of the week. To request the default first day of the week preferred by the locale, use `Locale.firstDayOfWeek` Corresponds to the "fw" key of the Unicode BCP 47 extension The preferred first day of the week that should be shown in a calendar view. Not necessarily the same as the first day after the weekend, and should not be determined from the weekend information
get numberingSystem(): (Locale_NumberingSystem) | nullSwift declarationvar numberingSystem: Locale.NumberingSystem?Set this to override the numbering system. To request the default numbering system used by the locale, use `Locale.numberingSystem` Corresponds to the "nu" key of the Unicode BCP 47 extension
set numberingSystem(value: (Locale_NumberingSystem) | null)Swift declarationvar numberingSystem: Locale.NumberingSystem?Set this to override the numbering system. To request the default numbering system used by the locale, use `Locale.numberingSystem` Corresponds to the "nu" key of the Unicode BCP 47 extension
get measurementSystem(): (Locale_MeasurementSystem) | nullSwift declarationvar measurementSystem: Locale.MeasurementSystem?Set this to override the measurement system. To request the default measurement system, use `Locale.measurementSystem` Corresponds to the "ms" key of the Unicode BCP 47 extension
set measurementSystem(value: (Locale_MeasurementSystem) | null)Swift declarationvar measurementSystem: Locale.MeasurementSystem?Set this to override the measurement system. To request the default measurement system, use `Locale.measurementSystem` Corresponds to the "ms" key of the Unicode BCP 47 extension
static initLocale(locale: Locale): Locale_ComponentsSwift declarationinit(locale: Locale)Creates a `Locale.Components` with the identifier of the specified `locale`. - Parameter locale: The locale whose identifier is used to create the component. If `Locale.current` or `Locale.autoupdatingCurrent` is specified, the created `Locale.Components` will contain user's preferred values as set in the system settings if available.
get region(): (Locale_Region) | nullSwift declarationvar region: Locale.Region?The region used by the locale. Set this property to override the region for region-related preferences, such as measuring system, calendar, and first day of the week. If unset, the locale uses the region of the language component. This property corresponds to the `rg` key of the Unicode BCP 47 extension.
set region(value: (Locale_Region) | null)Swift declarationvar region: Locale.Region?The region used by the locale. Set this property to override the region for region-related preferences, such as measuring system, calendar, and first day of the week. If unset, the locale uses the region of the language component. This property corresponds to the `rg` key of the Unicode BCP 47 extension.
get variant(): (Locale_Variant) | nullSwift declarationvar variant: Locale.Variant?Set this to specify a variant used for the locale Corresponds to the "va" key of the Unicode BCP 47 extension
set variant(value: (Locale_Variant) | null)Swift declarationvar variant: Locale.Variant?Set this to specify a variant used for the locale Corresponds to the "va" key of the Unicode BCP 47 extension
get calendar(): (Calendar_Identifier) | nullSwift declarationvar calendar: Calendar.Identifier?Set this to override the default calendar. To request the default calendar used by the locale, use `Locale.calendar` Corresponds to the "ca" key of the Unicode BCP 47 extension
set calendar(value: (Calendar_Identifier) | null)Swift declarationvar calendar: Calendar.Identifier?Set this to override the default calendar. To request the default calendar used by the locale, use `Locale.calendar` Corresponds to the "ca" key of the Unicode BCP 47 extension
get currency(): (Locale_Currency) | nullSwift declarationvar currency: Locale.Currency?Set this to override the currency. To request the default currency used by the locale, use `Locale.currency` Corresponds to the "cu" key of the Unicode BCP 47 extension
set currency(value: (Locale_Currency) | null)Swift declarationvar currency: Locale.Currency?Set this to override the currency. To request the default currency used by the locale, use `Locale.currency` Corresponds to the "cu" key of the Unicode BCP 47 extension
get timeZone(): (TimeZone) | nullSwift declarationvar timeZone: TimeZone?Set this to specify a time zone to associate with this locale Corresponds to the "tz" key of the Unicode BCP 47 extension
set timeZone(value: (TimeZone) | null)Swift declarationvar timeZone: TimeZone?Set this to specify a time zone to associate with this locale Corresponds to the "tz" key of the Unicode BCP 47 extension
get collation(): (Locale_Collation) | nullSwift declarationvar collation: Locale.Collation?Set this to override the string sort order. To request the default calendar used by the locale, use `Locale.calendar` Corresponds to the "co" key of the Unicode BCP 47 extension
set collation(value: (Locale_Collation) | null)Swift declarationvar collation: Locale.Collation?Set this to override the string sort order. To request the default calendar used by the locale, use `Locale.calendar` Corresponds to the "co" key of the Unicode BCP 47 extension
get hourCycle(): (Locale_HourCycle) | nullSwift declarationvar hourCycle: Locale.HourCycle?Set this to override the hour cycle. To request the default hour cycle, use `Locale.hourCycle` Corresponds to the "hc" key
set hourCycle(value: (Locale_HourCycle) | null)Swift declarationvar hourCycle: Locale.HourCycle?Set this to override the hour cycle. To request the default hour cycle, use `Locale.hourCycle` Corresponds to the "hc" key
No declarations were skipped in this snapshot.