diff --git a/files/en-us/web/javascript/reference/global_objects/intl/collator/resolvedoptions/index.md b/files/en-us/web/javascript/reference/global_objects/intl/collator/resolvedoptions/index.md index 6845d09862c7f43..35d47fcf7def884 100644 --- a/files/en-us/web/javascript/reference/global_objects/intl/collator/resolvedoptions/index.md +++ b/files/en-us/web/javascript/reference/global_objects/intl/collator/resolvedoptions/index.md @@ -7,8 +7,7 @@ browser-compat: javascript.builtins.Intl.Collator.resolvedOptions {{JSRef}} -The **`resolvedOptions()`** method of {{jsxref("Intl.Collator")}} instances returns a new object with properties reflecting the locale and collation options -computed during initialization of this collator object. +The **`resolvedOptions()`** method of {{jsxref("Intl.Collator")}} instances returns a new object with properties reflecting the options computed during initialization of this `Collator` object. {{EmbedInteractiveExample("pages/js/intl-collator-prototype-resolvedoptions.html")}} @@ -24,29 +23,22 @@ None. ### Return value -A new object with properties reflecting the locale and collation options computed -during the initialization of the given {{jsxref("Intl.Collator")}} object. - -## Description - -The resulting object has the following properties: +A new object with properties reflecting the options computed during the initialization of this `Collator` object. The object has the following properties, in the order they are listed: - `locale` - - : The BCP 47 language tag for the locale actually used. If any Unicode extension - values were requested in the input BCP 47 language tag that led to this locale, - the key-value pairs that were requested and are supported for this locale are - included in `locale`. -- `usage`, `sensitivity`, `ignorePunctuation` - - : The values provided for these properties in the `options` argument or - filled in as defaults. + - : The BCP 47 language tag for the locale actually used, determined by the [locale negotiation](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) process. Only the `co`, `kn`, and `kf` Unicode extension keys, if requested and supported, may be included in the output. +- `usage` + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"sort"` or `"search"`. The default is `"sort"`. +- `sensitivity` + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"base"`, `"accent"`, `"case"`, or `"variant"`. The default is `"variant"` for usage `"sort"`; it's locale dependent for usage `"search"`. +- `ignorePunctuation` + - : The value provided for this property in the `options` argument, with default filled in as needed. It is a boolean. The default is `true` for Thai (`th`) and `false` for all other languages. - `collation` - - : The value requested using the Unicode extension key `"co"`, if it is - supported for `locale`, or `"default"`. -- `numeric`, `caseFirst` - - : The values requested for these properties in the `options` argument or - using the Unicode extension keys `"kn"` and `"kf"` or filled - in as defaults. If the implementation does not support these properties, they are - omitted. + - : The value provided for this property in the `options` argument, or using the Unicode extension key `"co"`, with default filled in as needed. It is a supported [collation type](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getCollations#supported_collation_types) for this locale. The default is `"default"`. +- `numeric` + - : The value provided for this property in the `options` argument, or using the Unicode extension key `"kn"`, with default filled in as needed. It is a boolean. The default is `false`. If the implementation does not support this Unicode extension key, this property is omitted. +- `caseFirst` + - : The value provided for this property in the `options` argument, or using the Unicode extension key `"kf"`, with default filled in as needed. It is either `"upper"`, `"lower"`, or `"false"`. The default is `"false"`. If the implementation does not support this Unicode extension key, this property is omitted. ## Examples diff --git a/files/en-us/web/javascript/reference/global_objects/intl/datetimeformat/datetimeformat/index.md b/files/en-us/web/javascript/reference/global_objects/intl/datetimeformat/datetimeformat/index.md index 6668df37b7a6f70..c646588331233ac 100644 --- a/files/en-us/web/javascript/reference/global_objects/intl/datetimeformat/datetimeformat/index.md +++ b/files/en-us/web/javascript/reference/global_objects/intl/datetimeformat/datetimeformat/index.md @@ -31,7 +31,7 @@ Intl.DateTimeFormat(locales, options) - : A string with a BCP 47 language tag or an {{jsxref("Intl.Locale")}} instance, or an array of such locale identifiers. The runtime's default locale is used when `undefined` is passed or when none of the specified locale identifiers is supported. For the general form and interpretation of the `locales` argument, see [the parameter description on the `Intl` main page](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument). - The following Unicode extension key is allowed: + The following Unicode extension keys are allowed: - `nu` - : See [`numberingSystem`](#numberingsystem). diff --git a/files/en-us/web/javascript/reference/global_objects/intl/datetimeformat/resolvedoptions/index.md b/files/en-us/web/javascript/reference/global_objects/intl/datetimeformat/resolvedoptions/index.md index 1ac3c4ece7c1c92..e78b7f64ce155a0 100644 --- a/files/en-us/web/javascript/reference/global_objects/intl/datetimeformat/resolvedoptions/index.md +++ b/files/en-us/web/javascript/reference/global_objects/intl/datetimeformat/resolvedoptions/index.md @@ -7,7 +7,7 @@ browser-compat: javascript.builtins.Intl.DateTimeFormat.resolvedOptions {{JSRef}} -The **`resolvedOptions()`** method of {{jsxref("Intl.DateTimeFormat")}} instances returns a new object with properties reflecting the locale and date and time formatting options computed during initialization of this `Intl.DateTimeFormat` object. +The **`resolvedOptions()`** method of {{jsxref("Intl.DateTimeFormat")}} instances returns a new object with properties reflecting the options computed during initialization of this `DateTimeFormat` object. {{EmbedInteractiveExample("pages/js/intl-datetimeformat-prototype-resolvedoptions.html")}} @@ -23,33 +23,39 @@ None. ### Return value -A new object with properties reflecting the options computed during the initialization of the given {{jsxref("Intl.DateTimeFormat")}} object. The object has the following properties, in the order they are listed: +A new object with properties reflecting the options computed during the initialization of this `DateTimeFormat` object. The object has the following properties, in the order they are listed: - `locale` - - : The BCP 47 language tag for the locale actually used. Only the `ca`, `hc`, and `nu` Unicode extension keys may be included in the output. + - : The BCP 47 language tag for the locale actually used, determined by the [locale negotiation](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) process. Only the `ca`, `hc`, and `nu` Unicode extension keys, if requested, may be included in the output. - `calendar` - - : One of the [supported calendar types](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getCalendars#supported_calendar_types), reflecting the value provided for this property in the `options` argument or the `ca` Unicode extension key. The default is locale dependent. + - : The value provided for this property in the `options` argument, or using the Unicode extension key `"ca"`, with default filled in as needed. It is a supported [calendar type](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getCalendars#supported_calendar_types) for this locale. The default is locale dependent. - `numberingSystem` - - : One of the [supported numbering system types](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getNumberingSystems#supported_numbering_system_types), reflecting the value provided for this property in the `options` argument or the `nu` Unicode extension key. The default is locale dependent. + - : The value provided for this property in the `options` argument, or using the Unicode extension key `"nu"`, with default filled in as needed. It is a supported [numbering system](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getNumberingSystems#supported_numbering_system_types) for this locale. The default is locale dependent. - `timeZone` - - : One of the [IANA time zone names](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTimeZones), reflecting the value provided for this property in the `options` argument. The default is the runtime's default time zone; should never be `undefined`. + - : The value provided for this property in the `options` argument, with default filled in as needed. It is a canonicalized [IANA time zone name](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTimeZones). The default is the runtime's default time zone. > [!NOTE] > While the IANA database changes from time to time, the Unicode CLDR database (which browsers use) keeps old time zone names for stability purposes. All browsers canonicalize time zone names, but in different directions. For example, `new Intl.DateTimeFormat("en-US", { timeZone: "Europe/Kiev" }).resolvedOptions().timeZone` and `new Intl.DateTimeFormat("en-US", { timeZone: "Europe/Kyiv" }).resolvedOptions().timeZone` will return the same string in the same browser, but maybe different strings in different browsers. See {{jsxref("Intl/Locale/getTimeZones", "Intl.Locale.prototype.getTimeZones")}} for more information. -- `hourCycle` - - : The value provided for this property in the `options` argument, or provided in the Unicode extension key `"hc"`, with default filled in as needed. Only present if the `options` argument included `hour` or `timeStyle`. -- `hour12` - - : The value provided for this property in the `options` argument, or computed from the `hourCycle` property. Only present if the `options` argument included `hour` or `timeStyle`. -- `weekday`, `era`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, `fractionalSecondDigits`, `timeZoneName` - - : The values resulting from format matching between the corresponding properties in the `options` argument and the available combinations and representations for date-time formatting in the selected locale. Some of these properties may not be present, indicating that the corresponding components will not be represented in formatted output. If the `dateStyle` or `timeStyle` shortcuts were used in `options`, these individual component properties will never be present. -- `dateStyle`, `timeStyle` - - : The values provided for these properties in the `options` argument, if any. +- `hourCycle` {{optional_inline}} + - : The value provided for this property in the `options` argument, or using the Unicode extension key `"hc"`, with default filled in as needed. If `hour12` was provided in the `options`, then that overrides other `hourCycle` settings. It is only present if the resolved options also include `hour` or `timeStyle`. It is either `"h11"`, `"h12"`, `"h23"`, or `"h24"`. The default is locale dependent, although `"h24"` is never a default. +- `hour12` {{optional_inline}} + - : Calculated from `hourCycle`. It is only present if the resolved options also include `hour` or `timeStyle`. It is `true` if `hourCycle` is `"h11"` or `"h12"`, and `false` if `hourCycle` is `"h23"` or `"h24"`. +- `weekday`, `era`, `year`, `month`, `day`, `dayPeriod`, `hour`, `minute`, `second`, `fractionalSecondDigits`, `timeZoneName` {{optional_inline}} -## Description + - : The values resulting from format matching between the corresponding properties in the `options` argument and the available combinations and representations for date-time formatting in the selected locale. Some of these properties may not be present, indicating that the corresponding components will not be represented in formatted output. `weekday`, `era`, and `dayPeriod` are either `"narrow"`, `"short"`, or `"long"`; `year`, `day`, `hour`, `minute`, and `second` are either `"numeric"`, `"2-digit"`, or `"narrow"`; `month` is either `"numeric"`, `"2-digit"`, `"narrow"`, `"short"`, or `"long"`; `fractionalSecondDigits` is either `1`, `2`, or `3`; `timeZoneName` is either `"short"`, `"long"`, `"shortOffset"`, `"longOffset"`, `"shortGeneric"`, or `"longGeneric"`. -Although `dateStyle` and `timeStyle` are shortcuts for individual date and time component styles, the exact (locale dependent) component styles they resolve to are not included in the resolved options. This ensures the result of `resolvedOptions()` can be passed directly to the `Intl.DateTimeFormat()` constructor (because an `options` object with both `dateStyle` or `timeStyle` and individual date or time component styles is not valid). + If these properties were requested in `options`, the constructor prevents `dateStyle` and `timeStyle` from being specified, so the below group will never be present. + +- `dateStyle`, `timeStyle` {{optional_inline}} + + - : The values provided for these properties in the `options` argument. They are either `"full"`, `"long"`, `"medium"`, `"short"`, or `"none"`. Some of these properties may not be present, indicating that the corresponding components will not be represented in formatted output. + + If these properties were requested in `options`, the constructor prevents individual date time component options from being specified, so the above group will never be present. + + > [!NOTE] + > Although `dateStyle` and `timeStyle` are shortcuts for individual date and time component styles, the exact (locale dependent) component styles they resolve to are not included in the resolved options. This ensures the result of `resolvedOptions()` can be passed directly to the `Intl.DateTimeFormat()` constructor (because an `options` object with both `dateStyle` or `timeStyle` and individual date or time component styles is not valid). ## Examples diff --git a/files/en-us/web/javascript/reference/global_objects/intl/displaynames/resolvedoptions/index.md b/files/en-us/web/javascript/reference/global_objects/intl/displaynames/resolvedoptions/index.md index ad160b7a853cebc..22ebfa35f591b32 100644 --- a/files/en-us/web/javascript/reference/global_objects/intl/displaynames/resolvedoptions/index.md +++ b/files/en-us/web/javascript/reference/global_objects/intl/displaynames/resolvedoptions/index.md @@ -7,10 +7,7 @@ browser-compat: javascript.builtins.Intl.DisplayNames.resolvedOptions {{JSRef}} -The **`resolvedOptions()`** method of {{jsxref("Intl.DisplayNames")}} instances -returns a new object with properties reflecting the locale and style formatting -options computed during the construction of this `Intl.DisplayNames` -object. +The **`resolvedOptions()`** method of {{jsxref("Intl.DisplayNames")}} instances returns a new object with properties reflecting the options computed during initialization of this `DisplayNames` object. ## Syntax @@ -24,35 +21,18 @@ None. ### Return value -An object with properties reflecting the locale and formatting options computed during -the construction of the given {{jsxref("Intl.DisplayNames")}} object. - -## Description - -The object returned by `resolvedOptions()` has the following properties: +A new object with properties reflecting the options computed during the initialization of this `DisplayNames` object. The object has the following properties, in the order they are listed: - `locale` - - : The BCP 47 language tag for the locale actually used. If any Unicode extension - values were requested in the input BCP 47 language tag that led to this locale, - the key-value pairs that were requested and are supported for this locale are - included in `locale`. + - : The BCP 47 language tag for the locale actually used, determined by the [locale negotiation](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) process. No Unicode extension key will be included in the output. - `style` - - : The value provided for this property in the `options` argument of the - constructor or the default value (`"long"`). Its value is either - `"long"`, `"short"`, or `"narrow"`. + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"narrow"`, `"short"`, or `"long"`. The default is `"long"`. - `type` - - : The value provided for this property in the `options` argument of the - constructor or the default value (`"language"`). Its value is either - `"language"`, `"region"`, `"script"`, or - `"currency"`. + - : The value provided for this property in the `options` argument. It is either `"language"`, `"region"`, `"script"`, `"currency"`, `"calendar"`, or `"dateTimeField"`. It is required so there is no default. - `fallback` - - : The value provided for this property in the options argument of the constructor or - the default value (`"code"`). Its value is either `"code"` - or `"none"`. + - : The value provided for this property in the `options` argument. It is either `"code"` or `"none"`. The default is `"code"`. - `languageDisplay` - - : The value provided for this property in the options argument of the constructor or - the default value (`"dialect"`). Its value is either `"dialect"` - or `"standard"`. + - : The value provided for this property in the `options` argument. It is either `"dialect"` or `"standard"`. The default is `"dialect"`. ## Examples diff --git a/files/en-us/web/javascript/reference/global_objects/intl/durationformat/resolvedoptions/index.md b/files/en-us/web/javascript/reference/global_objects/intl/durationformat/resolvedoptions/index.md index 45f853b1344e586..11fe6e2f804d0a5 100644 --- a/files/en-us/web/javascript/reference/global_objects/intl/durationformat/resolvedoptions/index.md +++ b/files/en-us/web/javascript/reference/global_objects/intl/durationformat/resolvedoptions/index.md @@ -7,7 +7,7 @@ browser-compat: javascript.builtins.Intl.DurationFormat.resolvedOptions {{JSRef}} -The **`resolvedOptions()`** method of {{jsxref("Intl.DurationFormat")}} instances returns a new object with properties reflecting the locale and date and time formatting options computed during initialization of this {{jsxref("Intl.DurationFormat")}} object. +The **`resolvedOptions()`** method of {{jsxref("Intl.DurationFormat")}} instances returns a new object with properties reflecting the options computed during initialization of this `DurationFormat` object. ## Syntax @@ -21,60 +21,18 @@ None. ### Return value -A new object with properties reflecting the locale and date and time formatting options computed during the initialization of the given {{jsxref("Intl.DateTimeFormat")}} object. - -## Description - -The resulting object has the following properties: +A new object with properties reflecting the options computed during the initialization of this `DurationFormat` object. The object has the following properties, in the order they are listed: - `locale` - - : The [BCP 47 language tag](https://datatracker.ietf.org/doc/html/rfc5646) for the locale used. If any Unicode extension values were requested in the input BCP 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in `locale`. -- `style` - - : One of the strings `"long"`, `"short"`, `"narrow"`, or `"digital"` identifying the duration formatting style used. -- `years` - - : One of the strings `"long"`, `"short"`, or `"narrow"` identifying the formatting style used for the `years` field. -- `yearsDisplay` - - : One of the strings `"auto"` or `"always"` identifying when to display the `years` field. -- `months` - - : One of the strings `"long"`, `"short"`, `and "narrow"` identifying the formatting style used for the `months` field. -- `monthsDisplay` - - : One of the strings `"auto"` or `"always"` identifying when to display the `months` field. -- `weeks` - - : One of the strings `"long"`, `"short"`, `and "narrow"` identifying the formatting style used for the `weeks` field. -- `weeksDisplay` - - : One of the strings `"auto"` or `"always"` identifying when to display the `weeks` field. -- `days` - - : One of the strings `"long"`, `"short"`, and `"narrow"` identifying the formatting style used for the `days` field. -- `daysDisplay` - - : One of the strings `"auto"` or `"always"` identifying when to display the `days` field. -- `hours` - - : One of the strings `"long"`, `"short"`, `"narrow"`, `"2-digit"`, or `"numeric"` identifying the formatting style used for the `hours` field. -- `hoursDisplay` - - : One of the strings `"auto"` or `"always"` identifying when to display the `hours` field. -- `minutes` - - : One of the strings `"long"`, `"short"`, `"narrow"`, `"2-digit"`, or `"numeric"` identifying the formatting style used for the `minutes` field. -- `minutesDisplay` - - : One of the strings `"auto"` or `"always"` identifying when to display the `minutes` field. -- `seconds` - - : One of the strings `"long"`, `"short"`, `"narrow"`, `"2-digit"`, or `"numeric"` identifying the formatting style used for the `seconds` field. -- `secondsDisplay` - - : One of the strings `"auto"` or `"always"` identifying when to display the `seconds` field. -- `milliseconds` - - : One of the strings `"long"`, `"short"`, `"narrow"`, or `"numeric"` identifying the formatting style used for the `milliseconds` field. -- `millisecondsDisplay` - - : One of the strings `"auto"` or `"always"` identifying when to display the `millisecondsDisplay` field. -- `microseconds` - - : One of the strings `"long"`, `"short"`, `"narrow"`, or `"numeric"` identifying the formatting style used for the `microseconds` field. -- `microsecondsDisplay` - - : One of the strings `"auto"` or `"always"` identifying when to display the `microsecondsDisplay` field. -- `nanoseconds` - - : One of the strings `"long"`, `"short"`, `"narrow"`, or `"numeric"` identifying the formatting style used for the `nanoseconds` field. -- `nanosecondsDisplay` - - : One of the strings `"auto"` or `"always"` identifying when to display the `nanosecondsDisplay` field. -- `fractionalDigits` - - : A number, identifying the number of fractional digits used with numeric styles. + - : The BCP 47 language tag for the locale actually used, determined by the [locale negotiation](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) process. Only the `nu` Unicode extension key, if requested, may be included in the output. - `numberingSystem` - - : The value provided for this property in the options argument, if present, or the value requested using the Unicode extension key `nu` or filled in as a default. + - : The value provided for this property in the `options` argument, or using the Unicode extension key `"nu"`, with default filled in as needed. It is a supported [numbering system](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getNumberingSystems#supported_numbering_system_types) for this locale. The default is locale dependent. +- `style` + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"long"`, `"short"`, `"narrow"`, or `"digital"`. The default is `"short"`. +- `years`, `yearsDisplay`, `months`, `monthsDisplay`, `weeks`, `weeksDisplay`, `days`, `daysDisplay`, `hours`, `hoursDisplay`, `minutes`, `minutesDisplay`, `seconds`, `secondsDisplay`, `milliseconds`, `millisecondsDisplay`, `nanoseconds`, `nanosecondsDisplay` + - : The values provided for these properties in the `options` argument, with defaults filled in as needed. For the valid values and defaults for each, see the [`options`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat#options) argument of the constructor. +- `fractionalDigits` {{optional_inline}} + - : The value provided for this property in the `options` argument. It is only present if specified in `options`. It is an integer from 0 to 9, inclusive. ## Examples diff --git a/files/en-us/web/javascript/reference/global_objects/intl/listformat/resolvedoptions/index.md b/files/en-us/web/javascript/reference/global_objects/intl/listformat/resolvedoptions/index.md index 3599eaaab2aafb8..cc1a98605d5c4c1 100644 --- a/files/en-us/web/javascript/reference/global_objects/intl/listformat/resolvedoptions/index.md +++ b/files/en-us/web/javascript/reference/global_objects/intl/listformat/resolvedoptions/index.md @@ -7,9 +7,7 @@ browser-compat: javascript.builtins.Intl.ListFormat.resolvedOptions {{JSRef}} -The **`resolvedOptions()`** method of {{jsxref("Intl.ListFormat")}} instances -returns a new object with properties reflecting the locale and style formatting -options computed during the construction of this `Intl.ListFormat` object. +The **`resolvedOptions()`** method of {{jsxref("Intl.ListFormat")}} instances returns a new object with properties reflecting the options computed during initialization of this `ListFormat` object. {{EmbedInteractiveExample("pages/js/intl-listformat-prototype-resolvedoptions.html")}} @@ -25,26 +23,14 @@ None. ### Return value -An object with properties reflecting the locale and formatting options computed during -the construction of the given {{jsxref("Intl.ListFormat")}} object. - -## Description - -The object returned by `resolvedOptions()` has the following properties: +A new object with properties reflecting the options computed during the initialization of this `ListFormat` object. The object has the following properties, in the order they are listed: - `locale` - - : The BCP 47 language tag for the locale actually used. If any Unicode extension - values were requested in the input BCP 47 language tag that led to this locale, - the key-value pairs that were requested and are supported for this locale are - included in `locale`. -- `style` - - : The value provided for this property in the `options` argument of the - constructor or the default value (`"long"`). Its value is either - `"long"`, `"short"`, or `"narrow"`. + - : The BCP 47 language tag for the locale actually used, determined by the [locale negotiation](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) process. No Unicode extension key will be included in the output. - `type` - - : The value provided for this property in the `options` argument of the - constructor or the default value (`"conjunction"`). Its value is either - `"conjunction"`, `"disjunction"`, or `"unit"`. + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"conjunction"`, `"disjunction"`, or `"unit"`. The default is `"conjunction"`. +- `style` + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"long"`, `"short"`, or `"narrow"`. The default is `"long"`. ## Examples diff --git a/files/en-us/web/javascript/reference/global_objects/intl/numberformat/numberformat/index.md b/files/en-us/web/javascript/reference/global_objects/intl/numberformat/numberformat/index.md index 0880fa250c61bde..3c9c85c560f90f1 100644 --- a/files/en-us/web/javascript/reference/global_objects/intl/numberformat/numberformat/index.md +++ b/files/en-us/web/javascript/reference/global_objects/intl/numberformat/numberformat/index.md @@ -65,7 +65,7 @@ Depending on the `style` used, some of them may be ignored, and others may be re - `"unit"` - : For unit formatting. - `currency` - - : The currency to use in currency formatting. Possible values are the ISO 4217 currency codes, such as `"USD"` for the US dollar, `"EUR"` for the euro, or `"CNY"` for the Chinese RMB — see the [Current currency & funds code list](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes). There is no default value; if the `style` is `"currency"`, the `currency` property must be provided. + - : The currency to use in currency formatting. Possible values are the ISO 4217 currency codes, such as `"USD"` for the US dollar, `"EUR"` for the euro, or `"CNY"` for the Chinese RMB — see the [Current currency & funds code list](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes). There is no default value; if the `style` is `"currency"`, the `currency` property must be provided. It is normalized to uppercase. - `currencyDisplay` - : How to display the currency in currency formatting. - `"code"` @@ -104,7 +104,12 @@ The following properties are also supported by {{jsxref("Intl.PluralRules")}}. - `maximumSignificantDigits` - : The maximum number of significant digits to use. Possible values are from `1` to `21`; the default is `21`. -The above properties fall into two groups: `minimumIntegerDigits`, `minimumFractionDigits`, and `maximumFractionDigits` in one group, `minimumSignificantDigits` and `maximumSignificantDigits` in the other. If properties from both groups are specified, conflicts in the resulting display format are resolved based on the value of the [`roundingPriority`](#roundingpriority) property. +For the four options above (the `FractionDigits` and `SignificantDigits` options), we mentioned their defaults; however, these defaults are _not unconditionally applied_. They are only applied when the property is actually going to be used, which depends on the [`roundingPriority`](#roundingpriority) and [`notation`](#notation) settings. Specifically: + +- If `roundingPriority` is not `"auto"`, then all four options apply. +- If `roundingPriority` is `"auto"` and at least one `SignificantDigits` option is set, then the `SignificantDigits` options apply and the `FractionDigits` options are ignored. +- If `roundingPriority` is `"auto"`, and either at least one `FractionDigits` option is set or `notation` is not `"compact"`, then the `FractionDigits` options apply and the `SignificantDigits` options are ignored. +- If `roundingPriority` is `"auto"`, `notation` is `"compact"`, and none of the four options are set, then they are set to `{ minimumFractionDigits: 0, maximumFractionDigits: 0, minimumSignificantDigits: 1, maximumSignificantDigits: 2 }`, regardless of the defaults mentioned above, and `roundingPriority` is set to `"morePrecision"`. - `roundingPriority` @@ -118,11 +123,13 @@ The above properties fall into two groups: `minimumIntegerDigits`, `minimumFract - `"lessPrecision"` - : The result from the property that results in less precision is used. + The value `"auto"` is normalized to `"morePrecision"` if `notation` is `"compact"` and none of the four "FractionDigits"/"SignificantDigits" options are set. + Note that for values other than `auto` the result with more precision is calculated from the [`maximumSignificantDigits`](#minimumsignificantdigits) and [`maximumFractionDigits`](#maximumfractiondigits) (minimum fractional and significant digit settings are ignored). - `roundingIncrement` - - : Indicates the increment at which rounding should take place relative to the calculated rounding magnitude. Possible values are `1`, `2`, `5`, `10`, `20`, `25`, `50`, `100`, `200`, `250`, `500`, `1000`, `2000`, `2500`, and `5000`. It cannot be mixed with significant-digits rounding or any setting of `roundingPriority` other than `auto`. + - : Indicates the increment at which rounding should take place relative to the calculated rounding magnitude. Possible values are `1`, `2`, `5`, `10`, `20`, `25`, `50`, `100`, `200`, `250`, `500`, `1000`, `2000`, `2500`, and `5000`; the default is `1`. It cannot be mixed with significant-digits rounding or any setting of `roundingPriority` other than `auto`. - `roundingMode` diff --git a/files/en-us/web/javascript/reference/global_objects/intl/numberformat/resolvedoptions/index.md b/files/en-us/web/javascript/reference/global_objects/intl/numberformat/resolvedoptions/index.md index 0a699f275190783..c82a4fc9f737ac9 100644 --- a/files/en-us/web/javascript/reference/global_objects/intl/numberformat/resolvedoptions/index.md +++ b/files/en-us/web/javascript/reference/global_objects/intl/numberformat/resolvedoptions/index.md @@ -7,7 +7,7 @@ browser-compat: javascript.builtins.Intl.NumberFormat.resolvedOptions {{JSRef}} -The **`resolvedOptions()`** method of {{jsxref("Intl.NumberFormat")}} instances returns a new object with properties reflecting the [locale and number formatting options](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#parameters) computed during initialization of this `Intl.NumberFormat` object. +The **`resolvedOptions()`** method of {{jsxref("Intl.NumberFormat")}} instances returns a new object with properties reflecting the options computed during initialization of this `NumberFormat` object. {{EmbedInteractiveExample("pages/js/intl-numberformat-prototype-resolvedoptions.html")}} @@ -23,72 +23,46 @@ None. ### Return value -A new object with properties reflecting the [locale and number formatting options](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#parameters) computed during the construction of the given {{jsxref("Intl.NumberFormat")}} object. - -The resulting object has the following properties: - -- `compactDisplay` - - : Whether to use short or long form when using compact notation. - This is the value provided in the [`options.compactDisplay`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#compactdisplay) argument of the constructor, or the default value: `"short"`. - The value is only present if `notation` is set to "compact", and otherwise is `undefined`. -- `currency` - - : The currency to use in currency formatting. - The value is defined if `style` is `"currency"`, and is otherwise `undefined`. - This is the value provided in the [`options.currency`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currency) argument of the constructor. -- `currencyDisplay` - - : The display format for the currency, such as a symbol, or currency code. - The value is defined if `style` is `"currency"`, and otherwise is `undefined`. - This is the value provided in the [`options.currencyDisplay`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencydisplay) argument of the constructor, or the default value: `"symbol"`. -- `currencySign` - - : The method used to specify the sign of the currency value: `standard` or `accounting`. - The value is present if `style` is `"currency"`, and otherwise is `undefined`. - This is the value provided in the [`options.currencySign`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencysign) argument of the constructor, or the default value: `"standard"`. +A new object with properties reflecting the options computed during the initialization of this `NumberFormat` object. The object has the following properties, in the order they are listed: + - `locale` - - : The BCP 47 language tag for the locale that was actually used. - Matches one of the locales that were requested in the constructor [`locales`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#locales). -- `notation` - - : The formatting that should be applied to the number, such as `standard` or `engineering`. - This is the value provided in the [`options.notation`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#notation) argument of the constructor, or the default value: `"standard"`. + - : The BCP 47 language tag for the locale actually used, determined by the [locale negotiation](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) process. Only the `nu` Unicode extension key, if requested, may be included in the output. - `numberingSystem` - - : The numbering system. - This is the value provided in the [`options.numberingSystem`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#numberingsystem) argument of the constructor, if present, or the value set using the Unicode extension key [`nu`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#nu), or filled in as a default. + - : The value provided for this property in the `options` argument, or using the Unicode extension key `"nu"`, with default filled in as needed. It is a supported [numbering system](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getNumberingSystems#supported_numbering_system_types) for this locale. The default is locale dependent. +- `style` + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"decimal"`, `"percent"`, `"currency"`, or `"unit"`. The default is `"decimal"`. +- `currency` {{optional_inline}} + - : The value provided for this property in the `options` argument. It is only present if `style` is `"currency"`. It is an [ISO 4217 currency code](https://en.wikipedia.org/wiki/ISO_4217#List_of_ISO_4217_currency_codes). It is required if `style` is `"currency"` so there is no default. +- `currencyDisplay` {{optional_inline}} + - : The value provided for this property in the `options` argument, with default filled in as needed. It is only present if `style` is `"currency"`. It is either `"code"`, `"symbol"`, `"narrowSymbol"`, or `"name"`. The default is `"symbol"`. +- `currencySign` {{optional_inline}} + - : The value provided for this property in the `options` argument, with default filled in as needed. It is only present if `style` is `"currency"`. It is either `"standard"` or `"accounting"`. The default is `"standard"`. +- `unit` {{optional_inline}} + - : The value provided for this property in the `options` argument. It is only present if `style` is `"unit"`. It is a [sanctioned unit identifier](https://tc39.es/ecma402/#table-sanctioned-single-unit-identifiers) from the [full CLDR list](https://github.com/unicode-org/cldr/blob/main/common/validity/unit.xml). It is required if `style` is `"unit"` so there is no default. +- `unitDisplay` {{optional_inline}} + - : The value provided for this property in the `options` argument, with default filled in as needed. It is only present if `style` is `"unit"`. It is either `"short"`, `"narrow"`, or `"long"`. The default is `"short"`. +- `minimumIntegerDigits` + - : The value provided for this property in the `options` argument, with default filled in as needed. It is an integer between `1` and `21`. The default is `1`. +- `minimumFractionDigits`, `maximumFractionDigits` {{optional_inline}} + - : The value provided for these properties in the `options` argument, with defaults filled in as needed. They are only present if necessary; see [digit options](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#digit_options). It is an integer between `0` and `100`. +- `minimumSignificantDigits`, `maximumSignificantDigits` {{optional_inline}} + - : The value provided for these properties in the `options` argument, with defaults filled in as needed. They are only present if necessary; see [digit options](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#digit_options). It is an integer between `1` and `21`. +- `useGrouping` + - : The value provided for this property in the `options` argument, with default filled in as needed, and with some values normalized. It is either `"always"`, `"auto"`, `"min2"`, or the boolean `false`. The default is `"min2"` if `notation` is `"compact"`, and `"auto"` otherwise. +- `notation` + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"standard"`, `"scientific"`, `"engineering"`, or `"compact"`. The default is `"standard"`. +- `compactDisplay` {{optional_inline}} + - : The value provided for this property in the `options` argument, with default filled in as needed. It is only present if `notation` is `"compact"`. It is either `"short"` or `"long"`. The default is `"short"`. +- `signDisplay` + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"auto"`, `"always"`, `"exceptZero"`, `"negative"`, or `"never"`. The default is `"auto"`. - `roundingIncrement` - - : The rounding-increment precision (the increment used when rounding numbers). - This is the value specified in the [`options.roundingIncrement`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#roundingincrement) argument in the constructor. + - : The value provided for this property in the `options` argument, with default filled in as needed. It is one of `1`, `2`, `5`, `10`, `20`, `25`, `50`, `100`, `200`, `250`, `500`, `1000`, `2000`, `2500`, and `5000`. The default is `1`. - `roundingMode` - - : The rounding mode. - This is the value provided for the [`options.roundingMode`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#roundingmode) argument in the constructor, or the default value: `halfExpand`. + - : The value provided for this property in the `options` argument, with default filled in as needed. It is one of `"ceil"`, `"floor"`, `"expand"`, `"trunc"`, `"halfCeil"`, `"halfFloor"`, `"halfExpand"`, `"halfTrunc"`, and `"halfEven"`. The default is `"halfExpand"`. - `roundingPriority` - - : The priority for resolving rounding conflicts if both "FractionDigits" and "SignificantDigits" are specified. - This is the value provided for the [`options.roundingPriority`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#roundingpriority) argument in the constructor, or the default value: `auto`. -- `signDisplay` - - : Whether or not to display the positive/negative sign. - This is the value specified in the [`options.signDisplay`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#signdisplay) argument in the constructor, or the default value: `"auto"`. -- `unit` - - : The unit to use in unit formatting. - The value is only present if `style` is `"unit"`, and is otherwise `undefined`. - This is the value specified in the [`options.unit`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#unit) argument in the constructor. -- `unitDisplay` - - - : The display format to use for units in unit formatting, such as "long", "short" or "narrow". - The value is only present if `style` is `"unit"`, and is otherwise `undefined`. - This is the value specified in the [`options.unitDisplay`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#unitdisplay) argument in the constructor, or the default value: `short`. - -- `useGrouping` - - : Whether or not to use grouping separators to indicate "thousands", "millions" and son on. - This is the value specified in the [`options.useGrouping`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#usegrouping) argument in the constructor, or the default value: `"auto"`. + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"auto"`, `"morePrecision"`, or `"lessPrecision"`. The default is `"auto"`. - `trailingZeroDisplay` - - : The strategy for displaying trailing zeros on whole numbers. - This is the value specified in the [`options.trailingZeroDisplay`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#trailingzerodisplay) argument in the constructor, or the default value: `"auto"`. - -Only one of the following two groups of properties is included: - -- `minimumIntegerDigits`, `minimumFractionDigits`, `maximumFractionDigits` - - : The values provided for these properties in the `options` argument or filled in as defaults. - These properties are present only if neither `minimumSignificantDigits` nor `maximumSignificantDigits` was provided in the `options` argument. -- `minimumSignificantDigits`, `maximumSignificantDigits` - - : The values provided for these properties in the `options` argument or filled in as defaults. - These properties are present only if at least one of them was provided in the `options` argument. + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"auto"` or `"stripIfInteger"`. The default is `"auto"`. ## Examples diff --git a/files/en-us/web/javascript/reference/global_objects/intl/pluralrules/resolvedoptions/index.md b/files/en-us/web/javascript/reference/global_objects/intl/pluralrules/resolvedoptions/index.md index 78a88d0111a89a5..0c5451ada856994 100644 --- a/files/en-us/web/javascript/reference/global_objects/intl/pluralrules/resolvedoptions/index.md +++ b/files/en-us/web/javascript/reference/global_objects/intl/pluralrules/resolvedoptions/index.md @@ -7,7 +7,7 @@ browser-compat: javascript.builtins.Intl.PluralRules.resolvedOptions {{JSRef}} -The **`resolvedOptions()`** method of {{jsxref("Intl.PluralRules")}} instances returns a new object with properties reflecting the locale and plural formatting options computed during initialization of this `Intl.PluralRules` object. +The **`resolvedOptions()`** method of {{jsxref("Intl.PluralRules")}} instances returns a new object with properties reflecting the options computed during initialization of this `PluralRules` object. {{EmbedInteractiveExample("pages/js/intl-pluralrules-prototype-resolvedoptions.html")}} @@ -23,39 +23,26 @@ None. ### Return value -A new object with properties reflecting the locale and plural formatting options computed during the initialization of the given {{jsxref("Intl.PluralRules")}} object. - -The object has the following properties: +A new object with properties reflecting the options computed during the initialization of this `PluralRules` object. The object has the following properties, in the order they are listed: - `locale` - - : The BCP 47 language tag for the locale actually used. If any Unicode extension values were requested in the input BCP 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in `locale`. + - : The BCP 47 language tag for the locale actually used, determined by the [locale negotiation](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) process. No Unicode extension key will be included in the output. +- `type` + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"cardinal"` or `"ordinal"`. The default is `"cardinal"`. +- `minimumIntegerDigits`, `minimumFractionDigits`, `maximumFractionDigits` {{optional_inline}} + - : The value provided for these properties in the `options` argument, with defaults filled in as needed. These properties are present only if neither `minimumSignificantDigits` nor `maximumSignificantDigits` was provided in the `options` argument. +- `minimumSignificantDigits`, `maximumSignificantDigits` {{optional_inline}} + - : The value provided for these properties in the `options` argument, with defaults filled in as needed. These properties are present only if at least one of them was provided in the `options` argument. - `pluralCategories` - : An {{jsxref("Array")}} of plural categories used by the given locale, selected from the list `"zero"`, `"one"`, `"two"`, `"few"`, `"many"` and `"other"`. -- `type` - - - : The type used (`cardinal` or `ordinal`). - -- `roundingIncrement` {{experimental_inline}} - - : The rounding-increment precision (the increment used when rounding numbers). - This is the value specified in the `options.roundingIncrement` argument in the constructor. -- `roundingMode` {{experimental_inline}} - - : The rounding mode. - This is the value provided for the `options.roundingMode` argument in the constructor, or the default value: `halfExpand`. -- `roundingPriority` {{experimental_inline}} - - : The priority for resolving rounding conflicts if both "FractionDigits" and "SignificantDigits" are specified. - This is the value provided for the `options.roundingPriority` argument in the constructor, or the default value: `auto`. -- `trailingZeroDisplay` {{experimental_inline}} - - : The strategy for displaying trailing zeros on whole numbers. - This is the value specified in the `options.trailingZeroDisplay` argument in the constructor, or the default value: `"auto"`. - -Only one of the following two groups of properties is included: - -- `minimumIntegerDigits`, `minimumFractionDigits`, `maximumFractionDigits` - - : The values provided for these properties in the `options` argument or filled in as defaults. - These properties are present only if neither `minimumSignificantDigits` nor `maximumSignificantDigits` was provided in the `options` argument. -- `minimumSignificantDigits`, `maximumSignificantDigits` - - : The values provided for these properties in the `options` argument or filled in as defaults. - These properties are present only if at least one of them was provided in the `options` argument. +- `roundingIncrement` + - : The value provided for this property in the `options` argument, with default filled in as needed. It is one of `1`, `2`, `5`, `10`, `20`, `25`, `50`, `100`, `200`, `250`, `500`, `1000`, `2000`, `2500`, and `5000`. The default is `1`. +- `roundingMode` + - : The value provided for this property in the `options` argument, with default filled in as needed. It is one of `"ceil"`, `"floor"`, `"expand"`, `"trunc"`, `"halfCeil"`, `"halfFloor"`, `"halfExpand"`, `"halfTrunc"`, and `"halfEven"`. The default is `"halfExpand"`. +- `roundingPriority` + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"auto"`, `"morePrecision"`, or `"lessPrecision"`. The default is `"auto"`. +- `trailingZeroDisplay` + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"auto"` or `"stripIfInteger"`. The default is `"auto"`. ## Examples diff --git a/files/en-us/web/javascript/reference/global_objects/intl/relativetimeformat/resolvedoptions/index.md b/files/en-us/web/javascript/reference/global_objects/intl/relativetimeformat/resolvedoptions/index.md index 2af4a504f18e408..437f8e7d3e3d3d6 100644 --- a/files/en-us/web/javascript/reference/global_objects/intl/relativetimeformat/resolvedoptions/index.md +++ b/files/en-us/web/javascript/reference/global_objects/intl/relativetimeformat/resolvedoptions/index.md @@ -7,7 +7,7 @@ browser-compat: javascript.builtins.Intl.RelativeTimeFormat.resolvedOptions {{JSRef}} -The **`resolvedOptions()`** method of {{jsxref("Intl.RelativeTimeFormat")}} instances returns a new object with properties reflecting the locale and relative time formatting options computed during initialization of this `Intl.RelativeTimeFormat` object. +The **`resolvedOptions()`** method of {{jsxref("Intl.RelativeTimeFormat")}} instances returns a new object with properties reflecting the options computed during initialization of this `RelativeTimeFormat` object. {{EmbedInteractiveExample("pages/js/intl-relativetimeformat-prototype-resolvedoptions.html")}} @@ -23,31 +23,16 @@ None. ### Return value -A new object with properties reflecting the locale and number formatting options computed during the initialization of the given {{jsxref("Intl.RelativeTimeFormat")}} object. - -## Description - -The resulting object has the following properties: +A new object with properties reflecting the options computed during the initialization of this `RelativeTimeFormat` object. The object has the following properties, in the order they are listed: - `locale` - - : The BCP 47 language tag for the locale actually used. If any Unicode extension values were requested in the input BCP 47 language tag that led to this locale, the key-value pairs that were requested and are supported for this locale are included in `locale`. + - : The BCP 47 language tag for the locale actually used, determined by the [locale negotiation](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) process. Only the `nu` Unicode extension key, if requested, may be included in the output. - `style` - - - : The length of the internationalized message. Possible values are: - - - `"long"` (default, e.g., `in 1 month`) - - `"short"` (e.g., `in 1 mo.`), - - or `"narrow"` (e.g., `in 1 mo.`). The narrow style could be similar to the short style for some locales. - + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"long"`, `"short"`, or `"narrow"`. The default is `"long"`. - `numeric` - - - : The format of output message. Possible values are: - - - `"always"` (default, e.g., `1 day ago`), - - or `"auto"` (e.g., `yesterday`). The `"auto"` value allows to not always have to use numeric values in the output. - + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"always"` or `"auto"`. The default is `"always"`. - `numberingSystem` - - : The value requested using the Unicode extension key `"nu"` or filled in as a default. + - : The value provided for this property in the `options` argument, or using the Unicode extension key `"nu"`, with default filled in as needed. It is a supported [numbering system](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getNumberingSystems#supported_numbering_system_types) for this locale. The default is locale dependent. ## Examples diff --git a/files/en-us/web/javascript/reference/global_objects/intl/segmenter/resolvedoptions/index.md b/files/en-us/web/javascript/reference/global_objects/intl/segmenter/resolvedoptions/index.md index 06c431841524ffb..0606063cf4a7026 100644 --- a/files/en-us/web/javascript/reference/global_objects/intl/segmenter/resolvedoptions/index.md +++ b/files/en-us/web/javascript/reference/global_objects/intl/segmenter/resolvedoptions/index.md @@ -7,7 +7,7 @@ browser-compat: javascript.builtins.Intl.Segmenter.resolvedOptions {{JSRef}} -The **`resolvedOptions()`** method of {{jsxref("Intl.Segmenter")}} instances returns a new object with properties reflecting the locale and granularity options computed during the initialization of this `Intl.Segmenter` object. +The **`resolvedOptions()`** method of {{jsxref("Intl.Segmenter")}} instances returns a new object with properties reflecting the options computed during initialization of this `Segmenter` object. {{EmbedInteractiveExample("pages/js/intl-segmenter-prototype-resolvedoptions.html")}} @@ -23,21 +23,12 @@ None. ### Return value -A new object with properties reflecting the locale and collation options computed -during the initialization of the given [`Intl.Segmenter`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter) object. - -## Description - -The resulting object has the following properties: +A new object with properties reflecting the options computed during the initialization of this `Segmenter` object. The object has the following properties, in the order they are listed: - `locale` - - : The BCP 47 language tag for the locale actually used. If any Unicode extension - values were requested in the input BCP 47 language tag that led to this locale, - the key-value pairs that were requested and are supported for this locale are - included in `locale`. + - : The BCP 47 language tag for the locale actually used, determined by the [locale negotiation](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_identification_and_negotiation) process. No Unicode extension key will be included in the output. - `granularity` - - : The value provided for this property in the `options` argument or filled - in as the default. + - : The value provided for this property in the `options` argument, with default filled in as needed. It is either `"grapheme"`, `"word"`, or `"sentence"`. The default is `"grapheme"`. ## Examples