Intl.Locale.prototype.baseName
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2020ë 9ì.
Intl.Locale ì¸ì¤í´ì¤ì baseName ì ê·¼ì ìì±ì ì´ ë¡ì¼ì¼ì 문ìì´ ííì íì 문ìì´ì ë°ííë©°, ì¸ì´, ì¬ì© ê°ë¥í ê²½ì° ì§ì ë° ì¤í¬ë¦½í¸ ë± ì´ ë¡ì¼ì¼ì íµì¬ ì 보를 í¬í¨í©ëë¤.
ì¤ëª
baseNameì unicode_language_id 문ë²ì language ["-" script] ["-" region] *("-" variant) íì ìíì¤ë¥¼ ë°íí©ëë¤. ë¡ì¼ì¼ ìë³ì 문ìì´ ëë ìµì
ê°ì²´ë¥¼ íµí´ ìì±ììì ëª
ìì ì¼ë¡ ì§ì ë ì ë³´ë§ í¬í¨ë©ëë¤.
baseNameì ì¤ì ì ê·¼ìë undefinedì
ëë¤. ì´ ìì±ì ì§ì ë³ê²½í ì ììµëë¤.
ìì
>기본ì ì¸ ìì
js
const myLoc = new Intl.Locale("fr-Latn-CA"); // ë¡ì¼ì¼ì Canadian Frenchë¡ ì¤ì í©ëë¤
console.log(myLoc.toString()); // "fr-Latn-CA-u-ca-gregory"ê° ì¶ë ¥ë©ëë¤.
console.log(myLoc.baseName); // "fr-Latn-CA"ê° ì¶ë ¥ë©ëë¤.
ì ë ¥ 문ìì´ ìµì ìì
js
// ì¸ì´ë¥¼ ì¼ë³¸ì´ë¡, ì§ìì ì¼ë³¸ì´ë¡ ì¤ì
// ë¬ë ¥ì ê·¸ë ê³ ë¦¬ìë ¥ì¼ë¡, ìê° ì£¼ê¸°ë¥¼ 24ìê°ì¼ë¡ ì¤ì
const japan = new Intl.Locale("ja-JP-u-ca-gregory-hc-24");
console.log(japan.toString()); // "ja-JP-u-ca-gregory-hc-h24" ì¶ë ¥
console.log(japan.baseName); // "ja-JP" ì¶ë ¥
ì ë ¥ 문ìì´ì ìµì ì¼ë¡ ì¬ì ìíë ìì
js
// ë¤ëë°ëì´ì 벨기ì ì§ìì ê°ë¦¬í¤ë 문ìì´ì ì
ë ¥í©ëë¤.
// ê·¸ë¬ë ìµì
ê°ì²´ë ì§ìì ì¬ì ìíê³ ì´ë¥¼ ë¤ëëëë¡ ì¤ì í©ëë¤.
const dutch = new Intl.Locale("nl-Latn-BE", { region: "NL" });
console.log(dutch.baseName); // "nl-Latn-NL"를 ì¶ë ¥í©ëë¤.
ëª ì¸ì
| Specification |
|---|
| ECMAScript® 2027 Internationalization API Specification> # sec-Intl.Locale.prototype.baseName> |