Skip to content

Intl.DisplayNamesOptions missing property locale #46845

Closed

Description

@k2snowman69

Bug Report

Based on the MDN documentation resolvedOptions of DisplayNames (and all other intl apis) should contain a locale property
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/resolvedOptions

🔎 Search Terms

Intl.DisplayNamesOptions
resolvedOptions
locale

🕗 Version & Regression Information

4.5.2

  • I was unable to test this on prior versions because these types only became available in 4.5.2

⏯ Playground Link

Playground link with relevant code

💻 Code

// Copied from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames/resolvedOptions

const displayNames = new Intl.DisplayNames(['de-DE'], {type: 'region'});

const usedOptions = displayNames.resolvedOptions();
console.log(usedOptions.locale);   // "de-DE"
console.log(usedOptions.style);    // "long"
console.log(usedOptions.type);     // "region"
console.log(usedOptions.fallback); // "code"

🙁 Actual behavior

console.log(usedOptions.locale); has a typing error
Property 'locale' does not exist on type 'DisplayNamesOptions'.(2339)

🙂 Expected behavior

No type error because MDN's documentation seems to be correct across all browsers which support Intl.

Activity

  1. gfyoung commented on Dec 18, 2021

    @gfyoung
    Contributor

    Ryan Cavanaugh (@RyanCavanaugh) Orta Therox (@orta):

    This issue is related to #45647 as well.

    I saw you guys closed #47143 a few days ago and added it to the next release.

    Could this issue (and PR) also be reviewed and included as well?

  2. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScript

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions