Google is committed to advancing racial equity for Black communities. See how.

fuchsia.intl

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(fxbug.dev/81902): 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
result 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
result 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
result 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.

NameTypeDescriptionDefault
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.

NameTypeDescriptionDefault
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.

NameTypeDescriptionDefault
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

NameTypeDescriptionDefault
civil_time CivilTime No default

TimeZones_CivilToAbsoluteTime_Response

Defined in fuchsia.intl/time_zones.fidl

NameTypeDescriptionDefault
absolute_time zx/time No default

TimeZones_GetTimeZoneInfo_Response

Defined in fuchsia.intl/time_zones.fidl

NameTypeDescriptionDefault
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
SUNDAY 1
MONDAY 2
TUESDAY 3
WEDNESDAY 4
THURSDAY 5
FRIDAY 6
SATURDAY 7

Month strict

Type: uint8

Defined in fuchsia.intl/calendar.fidl

Enumeration of the months of the year.

NameValueDescription
JANUARY 1
FEBRUARY 2
MARCH 3
APRIL 4
MAY 5
JUNE 6
JULY 7
AUGUST 8
SEPTEMBER 9
OCTOBER 10
NOVEMBER 11
DECEMBER 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(fxbug.dev/82309): Implement AFTER_TRANSITION.

NameValueDescription
BEFORE_TRANSITION 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(fxbug.dev/82309): Implement BEFORE_TRANSITION and AFTER_TRANSITION.

NameValueDescription
REJECT 1

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

NEXT_VALID_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
CELSIUS 0

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

FAHRENHEIT 1

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

TimeZonesError flexible

Type: int32

Defined in fuchsia.intl/time_zones.fidl

NameValueDescription
INTERNAL_ERROR 1

An internal error has occurred within the service.

UNKNOWN_TIME_ZONE 2

The requested time zone ID is invalid.

INVALID_DATE 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.

OrdinalNameTypeDescription
1 year uint16

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

2 month Month

Month of the year.

3 day uint8

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

4 hour uint8

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

5 minute uint8

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

6 second uint8

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

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

7 nanos uint64

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

8 weekday DayOfWeek

Day of the week.

9 year_day uint16

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

10 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.

OrdinalNameTypeDescription
1 repeated_time_conversion RepeatedTimeConversion

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

Default: BEFORE_TRANSITION.

2 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.

OrdinalNameTypeDescription
1 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.

2 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.

3 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.

4 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.

OrdinalNameTypeDescription
1 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(fxbug.dev/81902): Additional fields with a breakdown of offsets and DST status.

OrdinalNameTypeDescription
1 id TimeZoneId

The time zone's IANA ID.

2 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.

UNIONS

TimeZones_AbsoluteToCivilTime_Result strict

Defined in fuchsia.intl/time_zones.fidl

NameTypeDescription
response TimeZones_AbsoluteToCivilTime_Response
err TimeZonesError

TimeZones_CivilToAbsoluteTime_Result strict

Defined in fuchsia.intl/time_zones.fidl

NameTypeDescription
response TimeZones_CivilToAbsoluteTime_Response
err TimeZonesError

TimeZones_GetTimeZoneInfo_Result strict

Defined in fuchsia.intl/time_zones.fidl

NameTypeDescription
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.