| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. Its been available across browsers since 2021 4.
Intl.DisplayNames , .
const regionNamesInEnglish = new Intl.DisplayNames(["en"], { type: "region" });
const regionNamesInTraditionalChinese = new Intl.DisplayNames(["zh-Hant"], {
type: "region",
});
console.log(regionNamesInEnglish.of("US"));
// Expected output: "United States"
console.log(regionNamesInTraditionalChinese.of("US"));
// Expected output: ""
Intl.DisplayNames() Intl.DisplayNames .
Intl.DisplayNames.prototype Intl.DisplayNames .
Intl.DisplayNames.prototype.constructor . Intl.DisplayNames Intl.DisplayNames .
Intl.DisplayNames.prototype[Symbol.toStringTag]Symbol.toStringTag "Intl.DisplayNames". Object.prototype.toString() .
Intl.DisplayNames.prototype.of() code Intl.DisplayNames .
Intl.DisplayNames.prototype.resolvedOptions().
Intl.DisplayNames , .
// .
let regionNames = new Intl.DisplayNames(["en"], { type: "region" });
regionNames.of("419"); // "Latin America"
regionNames.of("BZ"); // "Belize"
regionNames.of("US"); // "United States"
regionNames.of("BA"); // "Bosnia & Herzegovina"
regionNames.of("MM"); // "Myanmar (Burma)"
// .
regionNames = new Intl.DisplayNames(["ko"], { type: "region" });
regionNames.of("419"); // " "
regionNames.of("BZ"); // ""
regionNames.of("US"); // ""
regionNames.of("BA"); // " "
regionNames.of("MM"); // ""
Intl.DisplayNames , - - .
// .
let languageNames = new Intl.DisplayNames(["en"], { type: "language" });
languageNames.of("fr"); // "French"
languageNames.of("de"); // "German"
languageNames.of("fr-CA"); // "Canadian French"
languageNames.of("ko"); // "Traditional Chinese"
languageNames.of("en-US"); // "American English"
languageNames.of("zh-TW"); // "Chinese (Taiwan)"]
// .
languageNames = new Intl.DisplayNames(["ko"], { type: "language" });
languageNames.of("fr"); // ""
languageNames.of("zh"); // ""
languageNames.of("de"); // ""
Intl.DisplayNames .
// .
let scriptNames = new Intl.DisplayNames(["en"], { type: "script" });
// Get script names
scriptNames.of("Latn"); // "Latin"
scriptNames.of("Arab"); // "Arabic"
scriptNames.of("Kana"); // "Katakana"
// .
scriptNames = new Intl.DisplayNames(["ko"], { type: "script" });
scriptNames.of("Latn"); // ""
scriptNames.of("Arab"); // " "
scriptNames.of("Kana"); // ""
Intl.DisplayNames .
// .
let currencyNames = new Intl.DisplayNames(["en"], { type: "currency" });
//
currencyNames.of("USD"); // "US Dollar"
currencyNames.of("EUR"); // "Euro"
currencyNames.of("TWD"); // "New Taiwan Dollar"
currencyNames.of("CNY"); // "Chinese Yuan"
// .
currencyNames = new Intl.DisplayNames(["ko"], { type: "currency" });
currencyNames.of("USD"); // " "
currencyNames.of("EUR"); // ""
currencyNames.of("TWD"); // " "
currencyNames.of("CNY"); // " "
| Specification |
|---|
| ECMAScript 2027 Internationalization API Specification # intl-displaynames-objects |
This page was last modified on 2025 2 11 by MDN contributors.
Intl.DisplayNamesObject/FunctionObject.prototype.__defineGetter__()Object.prototype.__defineSetter__()Object.prototype.__lookupGetter__()Object.prototype.__lookupSetter__()Object.prototype.hasOwnProperty()Object.prototype.isPrototypeOf()Object.prototype.propertyIsEnumerable()Object.prototype.toLocaleString()Object.prototype.toString()Object.prototype.valueOf()IntlIntl.CollatorIntl.DateTimeFormatIntl.DurationFormatIntl.ListFormatIntl.LocaleIntl.NumberFormatIntl.PluralRulesIntl.RelativeTimeFormatIntl.SegmenterYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |