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
Name | Type |
---|---|
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
Name | Type |
---|---|
time_zone_id |
TimeZoneId
|
absolute_time |
zx/Time
|
Response
Name | Type |
---|---|
payload |
TimeZones_AbsoluteToCivilTime_Result
|
CivilToAbsoluteTime
Converts the given civil date and time in the given time zone to nanoseconds since the Unix epoch.
Request
Name | Type |
---|---|
civil_time |
CivilTime
|
options |
CivilToAbsoluteTimeOptions
|
Response
Name | Type |
---|---|
payload |
TimeZones_CivilToAbsoluteTime_Result
|
GetTimeZoneInfo
Retrieves details about a time zone at a specified one.
Request
Name | Type |
---|---|
time_zone_id |
TimeZoneId
|
at_time |
zx/Time
|
Response
Name | Type |
---|---|
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.
Field | Type | Description | Default |
---|---|---|---|
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.
Field | Type | Description | Default |
---|---|---|---|
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.
Field | Type | Description | Default |
---|---|---|---|
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
Field | Type | Description | Default |
---|---|---|---|
civil_time |
CivilTime
|
No default |
TimeZones_CivilToAbsoluteTime_Response
Defined in fuchsia.intl/time_zones.fidl
Field | Type | Description | Default |
---|---|---|---|
absolute_time |
zx/Time
|
No default |
TimeZones_GetTimeZoneInfo_Response
Defined in fuchsia.intl/time_zones.fidl
Field | Type | Description | Default |
---|---|---|---|
time_zone_info |
TimeZoneInfo
|
No default |
ENUMS
DayOfWeek strict
Type: uint8
Defined in fuchsia.intl/calendar.fidl
Enumeration of the days of the week.
Name | Value | Description |
---|---|---|
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.
Name | Value | Description |
---|---|---|
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(https://fxbug.dev/42162861): Implement AFTER_TRANSITION
.
Name | Value | Description |
---|---|---|
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,
|
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
.
Name | Value | Description |
---|---|---|
REJECT |
1 |
Returns |
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, |
TemperatureUnit strict
Type: uint32
Defined in fuchsia.intl/intl.fidl
Selection of temperature units.
Name | Value | Description |
---|---|---|
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
Name | Value | Description |
---|---|---|
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.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
year |
uint16
|
Year, in the closed range |
2 |
month |
Month
|
Month of the year. |
3 |
day |
uint8
|
Day of the month, in the closed range |
4 |
hour |
uint8
|
Hour of the day, in the closed range |
5 |
minute |
uint8
|
Minute of the hour, in the closed range |
6 |
second |
uint8
|
Second of the minute, in the closed range (Note that Fuchsia does not currently calculate leap seconds when converting dates.) |
7 |
nanos |
uint64
|
Nanosecond, in the closed range |
8 |
weekday |
DayOfWeek
|
Day of the week. |
9 |
year_day |
uint16
|
Day of the year, in the closed range |
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
.
Ordinal | Field | Type | Description |
---|---|---|---|
1 |
repeated_time_conversion |
RepeatedTimeConversion
|
Optional setting for handling repeated times during backward daylight savings time transitions. Default: |
2 |
skipped_time_conversion |
SkippedTimeConversion
|
Optional setting for handling skipped times during forward daylight savings time transitions. Default: |
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
.
Ordinal | Field | Type | Description |
---|---|---|---|
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 = |
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 |
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 |
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.
Ordinal | Field | Type | Description |
---|---|---|---|
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(https://fxbug.dev/42162409): Additional fields with a breakdown of offsets and DST status.
Ordinal | Field | Type | Description |
---|---|---|---|
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 ( |
3 |
in_dst_at_time |
bool
|
Indicates whether the time zone is in Daylight Savings Time at the queried time
( |
UNIONS
TimeZones_AbsoluteToCivilTime_Result strict
Defined in fuchsia.intl/time_zones.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
TimeZones_AbsoluteToCivilTime_Response
|
|
2 |
err |
TimeZonesError
|
TimeZones_CivilToAbsoluteTime_Result strict
Defined in fuchsia.intl/time_zones.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
TimeZones_CivilToAbsoluteTime_Response
|
|
2 |
err |
TimeZonesError
|
TimeZones_GetTimeZoneInfo_Result strict
Defined in fuchsia.intl/time_zones.fidl
Ordinal | Variant | Type | Description |
---|---|---|---|
1 |
response |
TimeZones_GetTimeZoneInfo_Response
|
|
2 |
err |
TimeZonesError
|
CONSTANTS
Name | Value | Type | Description |
---|---|---|---|
DEFAULT_TIME_ZONE_ID | UTC |
String |
This is the time zone reported when no time zones have been set. |