fuchsia.intl

Added: 7

PROTOCOLS

PropertyProvider

Defined in fuchsia.intl/property_provider.fidl

Provides internationalization properties.

Components that need to change their behavior in response to the user's internationalization profile may request an instance of this service from their namespace, if available. A component may choose to pass along the service that it received from its parent to its own children, or to override it and apply additional customizations.

See also fuchsia.ui.views.View.

GetProfile

Gets the user's internationalization profile.

Request

<EMPTY>

Response

NameType
profile Profile

OnChange

Indicates that the properties may have changed and the client should query them again.

Response

<EMPTY>

TimeZones

Defined in fuchsia.intl/time_zones.fidl

Provides information about time zones and offers date-time conversion methods.

TODO(https://fxbug.dev/42162409): Add time zone info methods, including offsets from UTC.

AbsoluteToCivilTime

Converts the given absolute time to a civil date and time in the given time zone, using the Gregorian calendar.

Request

NameType
time_zone_id TimeZoneId
absolute_time zx/Time

Response

NameType
payload TimeZones_AbsoluteToCivilTime_Result

CivilToAbsoluteTime

Converts the given civil date and time in the given time zone to nanoseconds since the Unix epoch.

Request

NameType
civil_time CivilTime
options CivilToAbsoluteTimeOptions

Response

NameType
payload TimeZones_CivilToAbsoluteTime_Result

GetTimeZoneInfo

Retrieves details about a time zone at a specified one.

Request

NameType
time_zone_id TimeZoneId
at_time zx/Time

Response

NameType
payload TimeZones_GetTimeZoneInfo_Result

STRUCTS

CalendarId

Defined in fuchsia.intl/intl.fidl

Typed identifier for a single calendar system. Currently consists only of a calendar ID.

FieldTypeDescriptionDefault
id string

Unicode BCP-47 Locale Identifier with an undefined language tag and a single extension specifying the calendar ID (from https://unicode.org/repos/cldr/trunk/common/bcp47/calendar.xml).

Examples: "und-u-ca-gregory" "und-u-ca-islamic"

No default

LocaleId

Defined in fuchsia.intl/intl.fidl

Typed identifier for a single Locale, which is a set of internationalization-related properties.

Most APIs that consume locales will probably want to accept a vector of locales to account for priority.

FieldTypeDescriptionDefault
id string

Unicode BCP-47 Locale Identifier (http://www.unicode.org/reports/tr35/#BCP_47_Conformance).

Must be canonicalized and well-formed. This field should not be populated from arbitrary user- or third-party input, but instead generated programmatically.

Includes language, region, script, and variant, plus Unicode extensions (under the "u" singleton). Other extensions are allowed but ignored.

Examples: "en-US" American English "fr-u-hc-h12" French, with 12-hour clock "ar-EG-u-fw-mon-nu-latn" Egyptian Arabic with "Latin" numerals and first day of week on Monday

No default

TimeZoneId

Defined in fuchsia.intl/intl.fidl

Typed identifier for a time zone.

FieldTypeDescriptionDefault
id string

Time zone ID from tzdata, e.g. "America/New_York". See https://www.iana.org/time-zones.

No default

TimeZones_AbsoluteToCivilTime_Response

Defined in fuchsia.intl/time_zones.fidl

FieldTypeDescriptionDefault
civil_time CivilTime No default

TimeZones_CivilToAbsoluteTime_Response

Defined in fuchsia.intl/time_zones.fidl

FieldTypeDescriptionDefault
absolute_time zx/Time No default

TimeZones_GetTimeZoneInfo_Response

Defined in fuchsia.intl/time_zones.fidl

FieldTypeDescriptionDefault
time_zone_info TimeZoneInfo No default

ENUMS

DayOfWeek strict

Type: uint8

Defined in fuchsia.intl/calendar.fidl

Enumeration of the days of the week.

NameValueDescription
1
2
3
4
5
6
7

Month strict

Type: uint8

Defined in fuchsia.intl/calendar.fidl

Enumeration of the months of the year.

NameValueDescription
1
2
3
4
5
6
7
8
9
10
11
12

RepeatedTimeConversion flexible

Type: int32

Defined in fuchsia.intl/time_zones.fidl

During a transition from daylight savings to standard time (when the clock is turned back), a civil time can correspond to two possible absolute times. This setting determines which of those times should be assumed during the conversion to absolute time.

TODO(https://fxbug.dev/42162861): Implement AFTER_TRANSITION.

NameValueDescription
1

Returns the wall clock time before the transition.

For example, in "America/New_York" on the night of the fall transition to standard time, 1:30 AM is interpreted as 01:30-04:00 (EDT), which is 05:30Z.

SkippedTimeConversion flexible

Type: int32

Defined in fuchsia.intl/time_zones.fidl

During a transition from standard time to daylight savings time (when the clock is turned forward), a span of civil times is skipped (usually one hour). This setting determines how invalid civil times within this span should be treated.

TODO(https://fxbug.dev/42162861): Implement BEFORE_TRANSITION and AFTER_TRANSITION.

NameValueDescription
1

Returns TimeZonesError::INVALID_DATE when trying to convert a skipped civil time.

2

Returns the closest valid time after the requested time.

For example, in "America/New_York" on the night of the spring transition to daylight savings time, 2:30 AM doesn't exist, so the next valid time, 3:00 AM (EDT) is returned instead.

TemperatureUnit strict

Type: uint32

Defined in fuchsia.intl/intl.fidl

Selection of temperature units.

NameValueDescription
0

The temperature should be formatted to show temperature in degrees Celsius.

1

The temperature should be formatted to show temperature in degrees Fahrenheit.

TimeZonesError flexible

Type: int32

Defined in fuchsia.intl/time_zones.fidl

NameValueDescription
1

An internal error has occurred within the service.

2

The requested time zone ID is invalid.

3

The provided date is out of range or invalid.

TABLES

CivilTime

Defined in fuchsia.intl/time_zones.fidl

Describes a time on a civil calendar (Gregorian), with nanosecond precision. This is roughly equivalent to the tm struct in time.h in the C standard library, and is intended as a structured intermediate format for printing or parsing dates.

OrdinalFieldTypeDescription
year uint16

Year, in the closed range [1678, 2262].

month Month

Month of the year.

day uint8

Day of the month, in the closed range [1, 31].

hour uint8

Hour of the day, in the closed range [0, 23].

minute uint8

Minute of the hour, in the closed range [0, 59].

second uint8

Second of the minute, in the closed range [0, 59].

(Note that Fuchsia does not currently calculate leap seconds when converting dates.)

nanos uint64

Nanosecond, in the closed range [0, 999_999_999].

weekday DayOfWeek

Day of the week.

year_day uint16

Day of the year, in the closed range [0, 365].

time_zone_id TimeZoneId

The time zone corresponding to this time. If omitted, the default is UTC.

CivilToAbsoluteTimeOptions

Defined in fuchsia.intl/time_zones.fidl

Options for TimeZones.CivilToAbsoluteTime.

OrdinalFieldTypeDescription
repeated_time_conversion RepeatedTimeConversion

Optional setting for handling repeated times during backward daylight savings time transitions.

Default: BEFORE_TRANSITION.

skipped_time_conversion SkippedTimeConversion

Optional setting for handling skipped times during forward daylight savings time transitions.

Default: NEXT_VALID_TIME.

Profile

Defined in fuchsia.intl/intl.fidl

A collection of ranked internationalization properties.

There is no implied origin for this information; it might come from a user account, device settings, a synthesis of user settings and app-specific overrides, or anywhere else.

Language-independent properties that are supported by Unicode BCP-47 Locale IDs (e.g. first-day-of-week, time zone) are denormalized into the locale IDs in locales.

OrdinalFieldTypeDescription
locales vector<LocaleId>

Ranked list of locales (in descending order of preference). The vector will always be set, and always contain at least one element. For example, locales = [ LocaleId("en-US") ] is valid, but locales = [], or locales = is not.

calendars vector<CalendarId>

Ranked list of calendars (in descending order of preference). The first entry is the primary calendar, and will be equal to the calendar indicated in locales. The vector will always be set, and always contain at least one element. The list allows multiple ranked preferences, and is intended for use by applications that can display multiple calendar systems.

time_zones vector<TimeZoneId>

Ranked list of time zones (in descending order). The first entry is the primary time zone, which should be used by default for formatting dates and times; it will be equal to the calendar indicated in locales. The list is intended for use by applications that can display multiple time zones, e.g. a world clock. The vector will always be set, and always contain at least one element. On Fuchsia, the default time zone is always DEFAULT_TIME_ZONE_ID when no more specific time zones have been defined or selected.

temperature_unit TemperatureUnit

Selected temperature unit. The unit is always reported: if there is no setting in the current environment, the default value of CELSIUS is used.

RegulatoryDomain

Defined in fuchsia.intl/intl.fidl

Typed identifier for a regulatory domain as specified in the IEEE 802.11 standard.

OrdinalFieldTypeDescription
country_code string

ISO 3166-1 alpha-2, a two-letter code representing a domain of operation. (https://www.iso.org/publication/PUB500001.html)

TimeZoneInfo

Defined in fuchsia.intl/time_zones.fidl

Describes a Time Zone's properties at a particular moment in time.

TODO(https://fxbug.dev/42162409): Additional fields with a breakdown of offsets and DST status.

OrdinalFieldTypeDescription
id TimeZoneId

The time zone's IANA ID.

total_offset_at_time zx/Duration

The total offset (including Daylight Savings, if the time zone is in Daylight Savings Time) from UTC at the queried time (at_time). If the time zone is ahead of UTC, this will be a positive value; if behind UTC, a negative value.

in_dst_at_time bool

Indicates whether the time zone is in Daylight Savings Time at the queried time (at_time).

UNIONS

TimeZones_AbsoluteToCivilTime_Result strict

Defined in fuchsia.intl/time_zones.fidl

OrdinalVariantTypeDescription
response TimeZones_AbsoluteToCivilTime_Response
err TimeZonesError

TimeZones_CivilToAbsoluteTime_Result strict

Defined in fuchsia.intl/time_zones.fidl

OrdinalVariantTypeDescription
response TimeZones_CivilToAbsoluteTime_Response
err TimeZonesError

TimeZones_GetTimeZoneInfo_Result strict

Defined in fuchsia.intl/time_zones.fidl

OrdinalVariantTypeDescription
response TimeZones_GetTimeZoneInfo_Response
err TimeZonesError

CONSTANTS

NameValueTypeDescription
DEFAULT_TIME_ZONE_ID UTC String

This is the time zone reported when no time zones have been set.