This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Intl.DisplayNames

Baseline Widely available

This feature is well established and works across many devices and browser versions. Itโ€™s 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.supportedLocalesOf()

๋Ÿฐํƒ€์ž„์˜ ๊ธฐ๋ณธ ๋กœ์ผ€์ผ๋กœ ๋Œ€์ฒด๋˜์ง€ ์•Š๊ณ , ์ œ๊ณต๋œ ๋กœ์ผ€์ผ ์ค‘ ์ง€์›๋˜๋Š” ๋กœ์ผ€์ผ์„ ํฌํ•จํ•œ ๋ฐฐ์—ด์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

์ธ์Šคํ„ด์Šค ์†์„ฑ

์ด ์†์„ฑ์€ 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๋ฅผ ์ƒ์„ฑํ•˜๊ณ , ์ง€์—ญ ์ฝ”๋“œ์— ๋Œ€ํ•œ ํ‘œ์‹œ ์ด๋ฆ„์„ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.

js
// ์˜์–ด๋กœ ์ง€์—ญ ํ‘œ์‹œ ์ด๋ฆ„์„ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.
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๋ฅผ ์ƒ์„ฑํ•˜๊ณ , ์–ธ์–ด-๋ฌธ์ž ์ฒด๊ณ„-์ง€์—ญ ์‹œํ€€์Šค์˜ ํ‘œ์‹œ ์ด๋ฆ„์„ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.

js
// ์˜์–ด๋กœ ์–ธ์–ด ํ‘œ์‹œ ์ด๋ฆ„์„ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.
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๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ๋ฌธ์ž ์ฝ”๋“œ์˜ ํ‘œ์‹œ ์ด๋ฆ„์„ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.

js
// ์˜์–ด๋กœ ๋ฌธ์ž ์ฒด๊ณ„ ํ‘œ์‹œ ์ด๋ฆ„์„ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.
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๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ํ†ตํ™” ์ฝ”๋“œ์˜ ํ‘œ์‹œ ์ด๋ฆ„์„ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.

js
// ์˜์–ด๋กœ ํ†ตํ™” ์ฝ”๋“œ์˜ ์ด๋ฆ„์„ ๊ฐ€์ ธ์˜ต๋‹ˆ๋‹ค.
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ยฎ 2026 Internationalization API Specification
# intl-displaynames-objects

๋ธŒ๋ผ์šฐ์ € ํ˜ธํ™˜์„ฑ

๊ฐ™์ด ๋ณด๊ธฐ