์ฝ˜ํ…์ธ  ๋Œ€ํ‘œ ์ด๋ฏธ์ง€ - ๐ŸŒ JavaScript ๊ตญ์ œํ™”์™€ Intl ๊ฐ์ฒด๋กœ ์ „ ์„ธ๊ณ„์™€ ์†Œํ†ตํ•˜๊ธฐ

๐ŸŒ JavaScript ๊ตญ์ œํ™”์™€ Intl ๊ฐ์ฒด๋กœ ์ „ ์„ธ๊ณ„์™€ ์†Œํ†ตํ•˜๊ธฐ

๋‹ค๊ตญ์–ด ์ง€์›, ์ด์ œ ์–ด๋ ต์ง€ ์•Š์•„์š”! ์นœ๊ตฌ์ฒ˜๋Ÿผ ์‰ฝ๊ฒŒ ์•Œ๋ ค๋“œ๋ฆด๊ฒŒ์š” ๐Ÿ˜Š

๐ŸŽฏ ์™œ ๊ตญ์ œํ™”๊ฐ€ ์ค‘์š”ํ• ๊นŒ์š”?

์—ฌ๋Ÿฌ๋ถ„, ํ˜น์‹œ ํ•ด์™ธ ์‚ฌ์ดํŠธ ๋“ค์–ด๊ฐ”๋‹ค๊ฐ€ ๋‚ ์งœ๊ฐ€ ์ด์ƒํ•˜๊ฒŒ ํ‘œ์‹œ๋˜๊ฑฐ๋‚˜, ๊ฐ€๊ฒฉ์ด ๋‹ฌ๋Ÿฌ๋กœ๋งŒ ๋‚˜์™€์„œ ๋‹นํ™ฉํ•œ ์  ์žˆ์œผ์‹ ๊ฐ€์š”? ๐Ÿค”

์š”์ฆ˜ ์›น ์„œ๋น„์Šค๋Š” ๊ตญ๊ฒฝ์ด ์—†์ž–์•„์š”. ํ•œ๊ตญ์—์„œ ๋งŒ๋“  ์„œ๋น„์Šค๊ฐ€ ๋ฏธ๊ตญ, ์ผ๋ณธ, ์œ ๋Ÿฝ์—์„œ๋„ ์‚ฌ์šฉ๋˜๋Š” ๊ฒŒ ๋‹น์—ฐํ•œ ์‹œ๋Œ€์˜ˆ์š”. ๊ทธ๋Ÿฐ๋ฐ ๋ฌธ์ œ๋Š” ๊ฐ ๋‚˜๋ผ๋งˆ๋‹ค ๋‚ ์งœ ํ‘œ๊ธฐ๋ฒ•๋„ ๋‹ค๋ฅด๊ณ , ์ˆซ์ž ํ‘œ๊ธฐ๋ฒ•๋„ ๋‹ค๋ฅด๊ณ , ํ†ตํ™” ๋‹จ์œ„๋„ ๋‹ค๋ฅด๋‹ค๋Š” ๊ฑฐ์ฃ !

์˜ˆ๋ฅผ ๋“ค์–ด๋ณผ๊นŒ์š”?
- ํ•œ๊ตญ: 2024๋…„ 1์›” 15์ผ, 1,234,567์›
- ๋ฏธ๊ตญ: January 15, 2024, $1,234,567.00
- ๋…์ผ: 15. Januar 2024, 1.234.567,00 โ‚ฌ

๊ฐ™์€ ์ •๋ณด์ธ๋ฐ ํ‘œํ˜„ ๋ฐฉ์‹์ด ์™„์ „ํžˆ ๋‹ค๋ฅด์ฃ ? ์ด๊ฑธ ์ผ์ผ์ด ์ฝ”๋”ฉ์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๋ ค๋ฉด... ์ƒ์ƒ๋งŒ ํ•ด๋„ ๋จธ๋ฆฌ๊ฐ€ ์•„ํŒŒ์š” ๐Ÿ˜ต

๋ฐ”๋กœ ์ด๋Ÿด ๋•Œ ํ•„์š”ํ•œ ๊ฒŒ ๊ตญ์ œํ™”(Internationalization, i18n)์˜ˆ์š”! ๊ทธ๋ฆฌ๊ณ  JavaScript๋Š” ์ด๋ฅผ ์œ„ํ•ด ๊ฐ•๋ ฅํ•œ ๋ฌด๊ธฐ์ธ Intl ๊ฐ์ฒด๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
KR US DE Intl Object Seamless Global Communication

๐Ÿ” Intl ๊ฐ์ฒด๋ž€ ๋ฌด์—‡์ธ๊ฐ€์š”?

Intl์€ ECMAScript Internationalization API์˜ ๋„ค์ž„์ŠคํŽ˜์ด์Šค์˜ˆ์š”. ์‰ฝ๊ฒŒ ๋งํ•˜๋ฉด, JavaScript๊ฐ€ ๊ธฐ๋ณธ์œผ๋กœ ์ œ๊ณตํ•˜๋Š” ๊ตญ์ œํ™” ๋„๊ตฌ ์„ธํŠธ๋ผ๊ณ  ๋ณด์‹œ๋ฉด ๋ผ์š”! ๐Ÿ› ๏ธ

Intl ๊ฐ์ฒด๋Š” ์—ฌ๋Ÿฌ ๊ฐ€์ง€ ์ƒ์„ฑ์ž(Constructor)๋ฅผ ์ œ๊ณตํ•˜๋Š”๋ฐ, ๊ฐ๊ฐ ํŠน์ • ๋ชฉ์ ์— ๋งž๊ฒŒ ์„ค๊ณ„๋˜์–ด ์žˆ์–ด์š”:

๐Ÿ“ฆ Intl์˜ ์ฃผ์š” ์ƒ์„ฑ์ž๋“ค 1๏ธโƒฃ Intl.DateTimeFormat - ๋‚ ์งœ์™€ ์‹œ๊ฐ„ ํ˜•์‹ํ™”
2๏ธโƒฃ Intl.NumberFormat - ์ˆซ์ž ํ˜•์‹ํ™”
3๏ธโƒฃ Intl.Collator - ๋ฌธ์ž์—ด ๋น„๊ต ๋ฐ ์ •๋ ฌ
4๏ธโƒฃ Intl.PluralRules - ๋ณต์ˆ˜ํ˜• ๊ทœ์น™ ์ฒ˜๋ฆฌ
5๏ธโƒฃ Intl.RelativeTimeFormat - ์ƒ๋Œ€์  ์‹œ๊ฐ„ ํ‘œํ˜„
6๏ธโƒฃ Intl.ListFormat - ๋ชฉ๋ก ํ˜•์‹ํ™”
7๏ธโƒฃ Intl.DisplayNames - ์–ธ์–ด, ์ง€์—ญ, ํ†ตํ™” ์ด๋ฆ„ ํ‘œ์‹œ
8๏ธโƒฃ Intl.Locale - ๋กœ์ผ€์ผ ์ •๋ณด ๊ด€๋ฆฌ
์™€, ๋งŽ์ฃ ? ๐Ÿ˜… ํ•˜์ง€๋งŒ ๊ฑฑ์ • ๋งˆ์„ธ์š”! ํ•˜๋‚˜์”ฉ ์นœ์ ˆํ•˜๊ฒŒ ์•Œ๋ ค๋“œ๋ฆด๊ฒŒ์š”.

๐Ÿ“… Intl.DateTimeFormat - ๋‚ ์งœ์™€ ์‹œ๊ฐ„ ๋งˆ์Šคํ„ฐํ•˜๊ธฐ

๋‚ ์งœ ํ˜•์‹์€ ๋‚˜๋ผ๋งˆ๋‹ค ์ •๋ง ์ฒœ์ฐจ๋งŒ๋ณ„์ด์—์š”. ๋ฏธ๊ตญ์€ ์›”/์ผ/๋…„ ์ˆœ์„œ๊ณ , ํ•œ๊ตญ์€ ๋…„/์›”/์ผ ์ˆœ์„œ์ฃ . ์ด๊ฑธ ์ˆ˜๋™์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๋ฉด ๋ฒ„๊ทธ ์ฒœ๊ตญ์ด ๋  ์ˆ˜ ์žˆ์–ด์š”! ๐Ÿ˜ฑ

๊ธฐ๋ณธ ์‚ฌ์šฉ๋ฒ•

// ํ•œ๊ตญ์–ด๋กœ ๋‚ ์งœ ํ‘œ์‹œ
const date = new Date('2024-01-15');
const koFormatter = new Intl.DateTimeFormat('ko-KR');
console.log(koFormatter.format(date)); 
// ์ถœ๋ ฅ: 2024. 1. 15.

// ์˜์–ด(๋ฏธ๊ตญ)๋กœ ๋‚ ์งœ ํ‘œ์‹œ
const enFormatter = new Intl.DateTimeFormat('en-US');
console.log(enFormatter.format(date));
// ์ถœ๋ ฅ: 1/15/2024

// ๋…์ผ์–ด๋กœ ๋‚ ์งœ ํ‘œ์‹œ
const deFormatter = new Intl.DateTimeFormat('de-DE');
console.log(deFormatter.format(date));
// ์ถœ๋ ฅ: 15.1.2024
๋ณด์„ธ์š”! ๊ฐ™์€ ๋‚ ์งœ์ธ๋ฐ ๋กœ์ผ€์ผ๋งŒ ๋ฐ”๊ฟ”์ฃผ๋ฉด ์ž๋™์œผ๋กœ ๊ทธ ๋‚˜๋ผ ํ˜•์‹์œผ๋กœ ๋ณ€ํ™˜๋ผ์š”. ๋งˆ๋ฒ• ๊ฐ™์ฃ ? โœจ

์˜ต์…˜์œผ๋กœ ์„ธ๋ฐ€ํ•˜๊ฒŒ ์กฐ์ •ํ•˜๊ธฐ

DateTimeFormat์€ ๋‹ค์–‘ํ•œ ์˜ต์…˜์„ ์ œ๊ณตํ•ด์š”. ์›ํ•˜๋Š” ๋Œ€๋กœ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•ํ•  ์ˆ˜ ์žˆ๋‹ต๋‹ˆ๋‹ค!

const date = new Date('2024-01-15T14:30:00');

// ๊ธด ํ˜•์‹์œผ๋กœ ํ‘œ์‹œ
const longFormatter = new Intl.DateTimeFormat('ko-KR', {
  year: 'numeric',
  month: 'long',
  day: 'numeric',
  weekday: 'long'
});
console.log(longFormatter.format(date));
// ์ถœ๋ ฅ: 2024๋…„ 1์›” 15์ผ ์›”์š”์ผ

// ์‹œ๊ฐ„ ํฌํ•จ
const timeFormatter = new Intl.DateTimeFormat('ko-KR', {
  year: 'numeric',
  month: '2-digit',
  day: '2-digit',
  hour: '2-digit',
  minute: '2-digit',
  second: '2-digit',
  hour12: false
});
console.log(timeFormatter.format(date));
// ์ถœ๋ ฅ: 2024. 01. 15. 14:30:00

// ๋ฏธ๊ตญ ์Šคํƒ€์ผ (12์‹œ๊ฐ„์ œ)
const usTimeFormatter = new Intl.DateTimeFormat('en-US', {
  year: 'numeric',
  month: 'long',
  day: 'numeric',
  hour: 'numeric',
  minute: 'numeric',
  hour12: true
});
console.log(usTimeFormatter.format(date));
// ์ถœ๋ ฅ: January 15, 2024 at 2:30 PM
๐Ÿ’ก ์‹ค์ „ ํŒ!

์›น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๊ฐœ๋ฐœํ•  ๋•Œ๋Š” ์‚ฌ์šฉ์ž์˜ ๋ธŒ๋ผ์šฐ์ € ๋กœ์ผ€์ผ์„ ์ž๋™์œผ๋กœ ๊ฐ์ง€ํ•ด์„œ ์‚ฌ์šฉํ•˜๋Š” ๊ฒŒ ์ข‹์•„์š”. navigator.language๋ฅผ ํ™œ์šฉํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค!

const userLocale = navigator.language || 'ko-KR';

const formatter = new Intl.DateTimeFormat(userLocale);

์ฃผ์š” ์˜ต์…˜ ์ •๋ฆฌ

์˜ต์…˜ ๊ฐ€๋Šฅํ•œ ๊ฐ’ ์„ค๋ช…
year numeric, 2-digit ์—ฐ๋„ ํ‘œ์‹œ ๋ฐฉ์‹
month numeric, 2-digit, long, short, narrow ์›” ํ‘œ์‹œ ๋ฐฉ์‹
day numeric, 2-digit ์ผ ํ‘œ์‹œ ๋ฐฉ์‹
weekday long, short, narrow ์š”์ผ ํ‘œ์‹œ ๋ฐฉ์‹
hour numeric, 2-digit ์‹œ๊ฐ„ ํ‘œ์‹œ ๋ฐฉ์‹
minute numeric, 2-digit ๋ถ„ ํ‘œ์‹œ ๋ฐฉ์‹
second numeric, 2-digit ์ดˆ ํ‘œ์‹œ ๋ฐฉ์‹
hour12 true, false 12์‹œ๊ฐ„์ œ/24์‹œ๊ฐ„์ œ ์„ ํƒ
timeZone IANA ์‹œ๊ฐ„๋Œ€ ์ด๋ฆ„ ํ‘œ์‹œํ•  ์‹œ๊ฐ„๋Œ€ (์˜ˆ: 'Asia/Seoul')

๐Ÿ’ฐ Intl.NumberFormat - ์ˆซ์ž์™€ ํ†ตํ™” ๋‹ค๋ฃจ๊ธฐ

์ˆซ์ž ํ‘œ๊ธฐ๋ฒ•๋„ ๋‚˜๋ผ๋งˆ๋‹ค ๋‹ฌ๋ผ์š”. ์ฒœ ๋‹จ์œ„ ๊ตฌ๋ถ„์ž๊ฐ€ ์‰ผํ‘œ์ธ ๋‚˜๋ผ๋„ ์žˆ๊ณ , ์ ์ธ ๋‚˜๋ผ๋„ ์žˆ์ฃ . ์†Œ์ˆ˜์ ๋„ ๋งˆ์ฐฌ๊ฐ€์ง€์˜ˆ์š”! ๐Ÿ’ธ

๊ธฐ๋ณธ ์ˆซ์ž ํ˜•์‹ํ™”

const number = 1234567.89;

// ํ•œ๊ตญ
const koNumber = new Intl.NumberFormat('ko-KR');
console.log(koNumber.format(number));
// ์ถœ๋ ฅ: 1,234,567.89

// ๋…์ผ (์ฒœ ๋‹จ์œ„ ์ , ์†Œ์ˆ˜์  ์‰ผํ‘œ)
const deNumber = new Intl.NumberFormat('de-DE');
console.log(deNumber.format(number));
// ์ถœ๋ ฅ: 1.234.567,89

// ์ธ๋„ (ํŠน์ดํ•œ ์ฒœ ๋‹จ์œ„ ๊ตฌ๋ถ„)
const inNumber = new Intl.NumberFormat('en-IN');
console.log(inNumber.format(number));
// ์ถœ๋ ฅ: 12,34,567.89
์ธ๋„ ์Šคํƒ€์ผ ๋ณด์…จ๋‚˜์š”? ์ฒœ ๋‹จ์œ„๊ฐ€ ๋‹ค๋ฅด๊ฒŒ ๊ตฌ๋ถ„๋˜์ฃ ! ์ด๋Ÿฐ ์„ธ์„ธํ•œ ์ฐจ์ด๊นŒ์ง€ ์ž๋™์œผ๋กœ ์ฒ˜๋ฆฌํ•ด์ค˜์š”. ๐Ÿ‘

ํ†ตํ™” ํ˜•์‹ํ™”

์ „์ž์ƒ๊ฑฐ๋ž˜ ์‚ฌ์ดํŠธ๋ฅผ ๋งŒ๋“ ๋‹ค๋ฉด ํ†ตํ™” ํ‘œ์‹œ๋Š” ํ•„์ˆ˜๊ฒ ์ฃ ? Intl.NumberFormat์ด ์™„๋ฒฝํ•˜๊ฒŒ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค!

const price = 1234567.89;

// ํ•œ๊ตญ ์›ํ™”
const krwFormatter = new Intl.NumberFormat('ko-KR', {
  style: 'currency',
  currency: 'KRW'
});
console.log(krwFormatter.format(price));
// ์ถœ๋ ฅ: โ‚ฉ1,234,568 (์›ํ™”๋Š” ์†Œ์ˆ˜์  ์—†์Œ)

// ๋ฏธ๊ตญ ๋‹ฌ๋Ÿฌ
const usdFormatter = new Intl.NumberFormat('en-US', {
  style: 'currency',
  currency: 'USD'
});
console.log(usdFormatter.format(price));
// ์ถœ๋ ฅ: $1,234,567.89

// ์œ ๋กœ (๋…์ผ ์Šคํƒ€์ผ)
const eurFormatter = new Intl.NumberFormat('de-DE', {
  style: 'currency',
  currency: 'EUR'
});
console.log(eurFormatter.format(price));
// ์ถœ๋ ฅ: 1.234.567,89 โ‚ฌ

// ์ผ๋ณธ ์—”ํ™”
const jpyFormatter = new Intl.NumberFormat('ja-JP', {
  style: 'currency',
  currency: 'JPY'
});
console.log(jpyFormatter.format(price));
// ์ถœ๋ ฅ: ยฅ1,234,568
๐ŸŽฏ ์ฃผ๋ชฉ! ํ†ตํ™”๋งˆ๋‹ค ์†Œ์ˆ˜์  ์ž๋ฆฟ์ˆ˜๊ฐ€ ๋‹ค๋ฅด๋‹ค๋Š” ๊ฑฐ ๋ˆˆ์น˜์ฑ„์…จ๋‚˜์š”? KRW์™€ JPY๋Š” ์†Œ์ˆ˜์ ์ด ์—†๊ณ , USD์™€ EUR์€ 2์ž๋ฆฌ์˜ˆ์š”. Intl.NumberFormat์ด ์ด๋Ÿฐ ๊ฒƒ๊นŒ์ง€ ์ž๋™์œผ๋กœ ์ฒ˜๋ฆฌํ•ด์ค๋‹ˆ๋‹ค! ๐Ÿ˜Ž

ํผ์„ผํŠธ์™€ ๋‹จ์œ„ ํ‘œ์‹œ

// ํผ์„ผํŠธ ํ‘œ์‹œ
const percentFormatter = new Intl.NumberFormat('ko-KR', {
  style: 'percent',
  minimumFractionDigits: 2,
  maximumFractionDigits: 2
});
console.log(percentFormatter.format(0.1234));
// ์ถœ๋ ฅ: 12.34%

// ๋‹จ์œ„ ํ‘œ์‹œ (ํ‚ฌ๋กœ๋ฏธํ„ฐ)
const unitFormatter = new Intl.NumberFormat('ko-KR', {
  style: 'unit',
  unit: 'kilometer',
  unitDisplay: 'long'
});
console.log(unitFormatter.format(1234.5));
// ์ถœ๋ ฅ: 1,234.5ํ‚ฌ๋กœ๋ฏธํ„ฐ

// ๋‹จ์œ„ ํ‘œ์‹œ (๋ฉ”๊ฐ€๋ฐ”์ดํŠธ)
const mbFormatter = new Intl.NumberFormat('en-US', {
  style: 'unit',
  unit: 'megabyte',
  unitDisplay: 'short'
});
console.log(mbFormatter.format(1024));
// ์ถœ๋ ฅ: 1,024 MB

์†Œ์ˆ˜์  ์ž๋ฆฟ์ˆ˜ ์ œ์–ด

const number = 1234.56789;

// ์†Œ์ˆ˜์  2์ž๋ฆฌ๋กœ ์ œํ•œ
const formatter1 = new Intl.NumberFormat('ko-KR', {
  minimumFractionDigits: 2,
  maximumFractionDigits: 2
});
console.log(formatter1.format(number));
// ์ถœ๋ ฅ: 1,234.57 (๋ฐ˜์˜ฌ๋ฆผ๋จ)

// ์ตœ์†Œ 3์ž๋ฆฌ, ์ตœ๋Œ€ 5์ž๋ฆฌ
const formatter2 = new Intl.NumberFormat('ko-KR', {
  minimumFractionDigits: 3,
  maximumFractionDigits: 5
});
console.log(formatter2.format(number));
// ์ถœ๋ ฅ: 1,234.56789

console.log(formatter2.format(1234.5));
// ์ถœ๋ ฅ: 1,234.500 (์ตœ์†Œ 3์ž๋ฆฌ ๋ณด์žฅ)
โš ๏ธ ์ฃผ์˜์‚ฌํ•ญ ํ†ตํ™” ์ฝ”๋“œ(currency)๋Š” ISO 4217 ํ‘œ์ค€์„ ๋”ฐ๋ผ์•ผ ํ•ด์š”. 'KRW', 'USD', 'EUR' ๊ฐ™์€ 3๊ธ€์ž ์ฝ”๋“œ๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ž˜๋ชป๋œ ์ฝ”๋“œ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•ด์š”!
โ‚ฉ KRW $ USD โ‚ฌ EUR Currency Formatting One Number, Multiple Formats

๐Ÿ”ค Intl.Collator - ๋ฌธ์ž์—ด ์ •๋ ฌ์˜ ๋‹ฌ์ธ

๋ฌธ์ž์—ด์„ ์ •๋ ฌํ•  ๋•Œ ๋‹จ์ˆœํžˆ ์•ŒํŒŒ๋ฒณ ์ˆœ์„œ๋กœ๋งŒ ํ•˜๋ฉด ์•ˆ ๋ผ์š”. ๊ฐ ์–ธ์–ด๋งˆ๋‹ค ์ •๋ ฌ ๊ทœ์น™์ด ๋‹ค๋ฅด๊ฑฐ๋“ ์š”! ์˜ˆ๋ฅผ ๋“ค์–ด ๋…์ผ์–ด์˜ 'รค'๋Š” 'a' ๋‹ค์Œ์— ์™€์•ผ ํ•˜๊ณ , ์Šค์›จ๋ด์–ด์—์„œ๋Š” 'รถ'๊ฐ€ ์•ŒํŒŒ๋ฒณ ๋์— ์œ„์น˜ํ•ด์š”. ๐Ÿ” 

๊ธฐ๋ณธ ์‚ฌ์šฉ๋ฒ•

const names = ['๊น€์ฒ ์ˆ˜', '์ด์˜ํฌ', '๋ฐ•๋ฏผ์ˆ˜', '์ตœ์ง€ํ›ˆ'];

// ํ•œ๊ตญ์–ด ์ •๋ ฌ
const koCollator = new Intl.Collator('ko-KR');
const sortedKo = names.sort(koCollator.compare);
console.log(sortedKo);
// ์ถœ๋ ฅ: ['๊น€์ฒ ์ˆ˜', '๋ฐ•๋ฏผ์ˆ˜', '์ด์˜ํฌ', '์ตœ์ง€ํ›ˆ']

// ๋…์ผ์–ด ๋‹จ์–ด ์ •๋ ฌ
const germanWords = ['ร„pfel', 'Birnen', 'Apfel', 'ร–sterreich'];
const deCollator = new Intl.Collator('de-DE');
const sortedDe = germanWords.sort(deCollator.compare);
console.log(sortedDe);
// ์ถœ๋ ฅ: ['Apfel', 'ร„pfel', 'Birnen', 'ร–sterreich']

๋Œ€์†Œ๋ฌธ์ž ๊ตฌ๋ถ„ ์˜ต์…˜

const words = ['apple', 'Apple', 'APPLE', 'banana'];

// ๋Œ€์†Œ๋ฌธ์ž ๊ตฌ๋ถ„ (๊ธฐ๋ณธ๊ฐ’)
const sensitiveCollator = new Intl.Collator('en-US', {
  sensitivity: 'variant'
});
console.log(words.sort(sensitiveCollator.compare));
// ์ถœ๋ ฅ: ['APPLE', 'Apple', 'apple', 'banana']

// ๋Œ€์†Œ๋ฌธ์ž ๋ฌด์‹œ
const insensitiveCollator = new Intl.Collator('en-US', {
  sensitivity: 'base'
});
console.log(words.sort(insensitiveCollator.compare));
// ์ถœ๋ ฅ: ['apple', 'Apple', 'APPLE', 'banana']

์ˆซ์ž๊ฐ€ ํฌํ•จ๋œ ๋ฌธ์ž์—ด ์ •๋ ฌ

const files = ['file1.txt', 'file10.txt', 'file2.txt', 'file20.txt'];

// ์ผ๋ฐ˜ ์ •๋ ฌ (๋ฌธ์ž์—ด๋กœ ์ทจ๊ธ‰)
console.log(files.sort());
// ์ถœ๋ ฅ: ['file1.txt', 'file10.txt', 'file2.txt', 'file20.txt']
// ๐Ÿ˜ฑ 10์ด 2๋ณด๋‹ค ์•ž์— ์™€๋ฒ„๋ฆผ!

// ์ˆซ์ž ์ธ์‹ ์ •๋ ฌ
const numericCollator = new Intl.Collator('en-US', {
  numeric: true
});
console.log(files.sort(numericCollator.compare));
// ์ถœ๋ ฅ: ['file1.txt', 'file2.txt', 'file10.txt', 'file20.txt']
// ๐Ÿ‘ ์˜ฌ๋ฐ”๋ฅธ ์ˆœ์„œ!
๐Ÿ’ก ์‹ค์ „ ํ™œ์šฉ! ํŒŒ์ผ ๋ชฉ๋ก, ๋ฒ„์ „ ๋ฒˆํ˜ธ, ์ฃผ์†Œ๋ก ๋“ฑ์„ ์ •๋ ฌํ•  ๋•Œ Intl.Collator๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์‚ฌ์šฉ์ž ๊ฒฝํ—˜์ด ํ›จ์”ฌ ์ข‹์•„์ ธ์š”. ํŠนํžˆ numeric: true ์˜ต์…˜์€ ์ •๋ง ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค!

โฐ Intl.RelativeTimeFormat - ์ƒ๋Œ€์  ์‹œ๊ฐ„ ํ‘œํ˜„

"3์ผ ์ „", "2์‹œ๊ฐ„ ํ›„" ๊ฐ™์€ ์ƒ๋Œ€์  ์‹œ๊ฐ„ ํ‘œํ˜„, ์ง์ ‘ ๊ตฌํ˜„ํ•˜๋ ค๋ฉด ๋ณต์žกํ•˜์ฃ ? RelativeTimeFormat์ด ํ•ด๊ฒฐํ•ด์ค๋‹ˆ๋‹ค! โŒš

// ํ•œ๊ตญ์–ด
const rtfKo = new Intl.RelativeTimeFormat('ko-KR', {
  numeric: 'auto'
});

console.log(rtfKo.format(-1, 'day'));    // ์–ด์ œ
console.log(rtfKo.format(0, 'day'));     // ์˜ค๋Š˜
console.log(rtfKo.format(1, 'day'));     // ๋‚ด์ผ
console.log(rtfKo.format(-3, 'day'));    // 3์ผ ์ „
console.log(rtfKo.format(2, 'week'));    // 2์ฃผ ํ›„
console.log(rtfKo.format(-5, 'month'));  // 5๊ฐœ์›” ์ „
console.log(rtfKo.format(1, 'year'));    // 1๋…„ ํ›„

// ์˜์–ด
const rtfEn = new Intl.RelativeTimeFormat('en-US', {
  numeric: 'auto'
});

console.log(rtfEn.format(-1, 'day'));    // yesterday
console.log(rtfEn.format(0, 'day'));     // today
console.log(rtfEn.format(1, 'day'));     // tomorrow
console.log(rtfEn.format(-3, 'day'));    // 3 days ago
console.log(rtfEn.format(2, 'week'));    // in 2 weeks

์Šคํƒ€์ผ ์˜ต์…˜

const value = -3;
const unit = 'day';

// long ์Šคํƒ€์ผ (๊ธฐ๋ณธ๊ฐ’)
const rtfLong = new Intl.RelativeTimeFormat('ko-KR', {
  style: 'long'
});
console.log(rtfLong.format(value, unit));
// ์ถœ๋ ฅ: 3์ผ ์ „

// short ์Šคํƒ€์ผ
const rtfShort = new Intl.RelativeTimeFormat('ko-KR', {
  style: 'short'
});
console.log(rtfShort.format(value, unit));
// ์ถœ๋ ฅ: 3์ผ ์ „

// narrow ์Šคํƒ€์ผ
const rtfNarrow = new Intl.RelativeTimeFormat('ko-KR', {
  style: 'narrow'
});
console.log(rtfNarrow.format(value, unit));
// ์ถœ๋ ฅ: 3์ผ์ „

์‹ค์ „ ์˜ˆ์ œ: ๊ฒŒ์‹œ๊ธ€ ์ž‘์„ฑ ์‹œ๊ฐ„ ํ‘œ์‹œ

function getRelativeTime(date, locale = 'ko-KR') {
  const now = new Date();
  const diff = date - now;
  const seconds = Math.floor(diff / 1000);
  const minutes = Math.floor(seconds / 60);
  const hours = Math.floor(minutes / 60);
  const days = Math.floor(hours / 24);
  const weeks = Math.floor(days / 7);
  const months = Math.floor(days / 30);
  const years = Math.floor(days / 365);
  
  const rtf = new Intl.RelativeTimeFormat(locale, { numeric: 'auto' });
  
  if (Math.abs(years) > 0) return rtf.format(years, 'year');
  if (Math.abs(months) > 0) return rtf.format(months, 'month');
  if (Math.abs(weeks) > 0) return rtf.format(weeks, 'week');
  if (Math.abs(days) > 0) return rtf.format(days, 'day');
  if (Math.abs(hours) > 0) return rtf.format(hours, 'hour');
  if (Math.abs(minutes) > 0) return rtf.format(minutes, 'minute');
  return rtf.format(seconds, 'second');
}

// ์‚ฌ์šฉ ์˜ˆ
const postDate = new Date('2024-01-12');
console.log(getRelativeTime(postDate));
// ์ถœ๋ ฅ: 3์ผ ์ „ (ํ˜„์žฌ ๋‚ ์งœ ๊ธฐ์ค€)
๐ŸŽจ SNS๋‚˜ ๋ธ”๋กœ๊ทธ ๊ฐœ๋ฐœํ•  ๋•Œ ์™„์ „ ์œ ์šฉํ•ด์š”! ํŽ˜์ด์Šค๋ถ, ํŠธ์œ„ํ„ฐ ๊ฐ™์€ SNS์—์„œ ๋ณด๋Š” "5๋ถ„ ์ „", "์–ด์ œ" ๊ฐ™์€ ํ‘œํ˜„์„ ์‰ฝ๊ฒŒ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ์–ด์š”. ์‚ฌ์šฉ์ž ๊ฒฝํ—˜์ด ํ™• ์ข‹์•„์ง‘๋‹ˆ๋‹ค! ๐Ÿš€

๐Ÿ“ Intl.ListFormat - ๋ชฉ๋ก ํ˜•์‹ํ™”

๋ฐฐ์—ด์„ ์ž์—ฐ์Šค๋Ÿฌ์šด ๋ฌธ์žฅ์œผ๋กœ ๋งŒ๋“ค์–ด์ฃผ๋Š” ๊ธฐ๋Šฅ์ด์—์š”. "์‚ฌ๊ณผ, ๋ฐ”๋‚˜๋‚˜, ๊ทธ๋ฆฌ๊ณ  ์˜ค๋ Œ์ง€" ๊ฐ™์€ ํ‘œํ˜„์„ ์ž๋™์œผ๋กœ ๋งŒ๋“ค์–ด์ค˜์š”! ๐ŸŽ๐ŸŒ๐ŸŠ

const fruits = ['์‚ฌ๊ณผ', '๋ฐ”๋‚˜๋‚˜', '์˜ค๋ Œ์ง€'];

// ํ•œ๊ตญ์–ด - ์ ‘์†์‚ฌ ์Šคํƒ€์ผ
const listKo = new Intl.ListFormat('ko-KR', {
  style: 'long',
  type: 'conjunction'
});
console.log(listKo.format(fruits));
// ์ถœ๋ ฅ: ์‚ฌ๊ณผ, ๋ฐ”๋‚˜๋‚˜ ๋ฐ ์˜ค๋ Œ์ง€

// ์˜์–ด - ์ ‘์†์‚ฌ ์Šคํƒ€์ผ
const listEn = new Intl.ListFormat('en-US', {
  style: 'long',
  type: 'conjunction'
});
console.log(listEn.format(fruits));
// ์ถœ๋ ฅ: ์‚ฌ๊ณผ, ๋ฐ”๋‚˜๋‚˜, and ์˜ค๋ Œ์ง€

// ์„ ํƒ์ง€ ์Šคํƒ€์ผ (or)
const listOr = new Intl.ListFormat('ko-KR', {
  type: 'disjunction'
});
console.log(listOr.format(fruits));
// ์ถœ๋ ฅ: ์‚ฌ๊ณผ, ๋ฐ”๋‚˜๋‚˜ ๋˜๋Š” ์˜ค๋ Œ์ง€

๋‹ค์–‘ํ•œ ์Šคํƒ€์ผ

const items = ['HTML', 'CSS', 'JavaScript'];

// long ์Šคํƒ€์ผ
const longList = new Intl.ListFormat('ko-KR', {
  style: 'long',
  type: 'conjunction'
});
console.log(longList.format(items));
// ์ถœ๋ ฅ: HTML, CSS ๋ฐ JavaScript

// short ์Šคํƒ€์ผ
const shortList = new Intl.ListFormat('ko-KR', {
  style: 'short',
  type: 'conjunction'
});
console.log(shortList.format(items));
// ์ถœ๋ ฅ: HTML, CSS, JavaScript

// narrow ์Šคํƒ€์ผ
const narrowList = new Intl.ListFormat('ko-KR', {
  style: 'narrow',
  type: 'conjunction'
});
console.log(narrowList.format(items));
// ์ถœ๋ ฅ: HTML, CSS, JavaScript
๐ŸŽฏ ์‹ค์ „ ํ™œ์šฉ ์‹œ๋‚˜๋ฆฌ์˜ค 1๏ธโƒฃ ๊ฒ€์ƒ‰ ํ•„ํ„ฐ ํ‘œ์‹œ: "๋นจ๊ฐ•, ํŒŒ๋ž‘ ๋˜๋Š” ์ดˆ๋ก ์ƒ‰์ƒ"
2๏ธโƒฃ ์„ ํƒ๋œ ์˜ต์…˜ ํ‘œ์‹œ: "์‚ฌ์ด์ฆˆ M, L ๋ฐ XL ์„ ํƒ๋จ"
3๏ธโƒฃ ํƒœ๊ทธ ๋ชฉ๋ก: "JavaScript, React ๋ฐ Node.js"
4๏ธโƒฃ ์ฐธ์—ฌ์ž ๋ชฉ๋ก: "๊น€์ฒ ์ˆ˜, ์ด์˜ํฌ ๊ทธ๋ฆฌ๊ณ  ๋ฐ•๋ฏผ์ˆ˜"

๐Ÿท๏ธ Intl.DisplayNames - ์ด๋ฆ„ ํ‘œ์‹œํ•˜๊ธฐ

์–ธ์–ด ์ด๋ฆ„, ๊ตญ๊ฐ€ ์ด๋ฆ„, ํ†ตํ™” ์ด๋ฆ„ ๋“ฑ์„ ํ˜„์ง€ํ™”๋œ ํ˜•ํƒœ๋กœ ํ‘œ์‹œํ•ด์ฃผ๋Š” ๊ธฐ๋Šฅ์ด์—์š”. ์ฝ”๋“œ๋งŒ ์•Œ๋ฉด ์ž๋™์œผ๋กœ ์ด๋ฆ„์„ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ์–ด์š”! ๐ŸŒ

์–ธ์–ด ์ด๋ฆ„ ํ‘œ์‹œ

// ํ•œ๊ตญ์–ด๋กœ ์–ธ์–ด ์ด๋ฆ„ ํ‘œ์‹œ
const languageNamesKo = new Intl.DisplayNames(['ko-KR'], {
  type: 'language'
});

console.log(languageNamesKo.of('en'));    // ์˜์–ด
console.log(languageNamesKo.of('ko'));    // ํ•œ๊ตญ์–ด
console.log(languageNamesKo.of('ja'));    // ์ผ๋ณธ์–ด
console.log(languageNamesKo.of('zh'));    // ์ค‘๊ตญ์–ด
console.log(languageNamesKo.of('fr'));    // ํ”„๋ž‘์Šค์–ด

// ์˜์–ด๋กœ ์–ธ์–ด ์ด๋ฆ„ ํ‘œ์‹œ
const languageNamesEn = new Intl.DisplayNames(['en-US'], {
  type: 'language'
});

console.log(languageNamesEn.of('ko'));    // Korean
console.log(languageNamesEn.of('ja'));    // Japanese

๊ตญ๊ฐ€/์ง€์—ญ ์ด๋ฆ„ ํ‘œ์‹œ

// ํ•œ๊ตญ์–ด๋กœ ๊ตญ๊ฐ€ ์ด๋ฆ„ ํ‘œ์‹œ
const regionNamesKo = new Intl.DisplayNames(['ko-KR'], {
  type: 'region'
});

console.log(regionNamesKo.of('KR'));    // ๋Œ€ํ•œ๋ฏผ๊ตญ
console.log(regionNamesKo.of('US'));    // ๋ฏธ๊ตญ
console.log(regionNamesKo.of('JP'));    // ์ผ๋ณธ
console.log(regionNamesKo.of('CN'));    // ์ค‘๊ตญ
console.log(regionNamesKo.of('GB'));    // ์˜๊ตญ

// ์˜์–ด๋กœ ๊ตญ๊ฐ€ ์ด๋ฆ„ ํ‘œ์‹œ
const regionNamesEn = new Intl.DisplayNames(['en-US'], {
  type: 'region'
});

console.log(regionNamesEn.of('KR'));    // South Korea
console.log(regionNamesEn.of('JP'));    // Japan

ํ†ตํ™” ์ด๋ฆ„ ํ‘œ์‹œ

// ํ•œ๊ตญ์–ด๋กœ ํ†ตํ™” ์ด๋ฆ„ ํ‘œ์‹œ
const currencyNamesKo = new Intl.DisplayNames(['ko-KR'], {
  type: 'currency'
});

console.log(currencyNamesKo.of('KRW'));    // ๋Œ€ํ•œ๋ฏผ๊ตญ ์›
console.log(currencyNamesKo.of('USD'));    // ๋ฏธ๊ตญ ๋‹ฌ๋Ÿฌ
console.log(currencyNamesKo.of('EUR'));    // ์œ ๋กœ
console.log(currencyNamesKo.of('JPY'));    // ์ผ๋ณธ ์—”
console.log(currencyNamesKo.of('GBP'));    // ์˜๊ตญ ํŒŒ์šด๋“œ

// ์˜์–ด๋กœ ํ†ตํ™” ์ด๋ฆ„ ํ‘œ์‹œ
const currencyNamesEn = new Intl.DisplayNames(['en-US'], {
  type: 'currency'
});

console.log(currencyNamesEn.of('KRW'));    // South Korean Won
console.log(currencyNamesEn.of('EUR'));    // Euro
๐Ÿ’ก ์–ธ์ œ ์‚ฌ์šฉํ•˜๋ฉด ์ข‹์„๊นŒ์š”? โœ… ์–ธ์–ด ์„ ํƒ ๋“œ๋กญ๋‹ค์šด ๋ฉ”๋‰ด
โœ… ๊ตญ๊ฐ€ ์„ ํƒ ํผ
โœ… ํ†ตํ™” ์„ ํƒ ์˜ต์…˜
โœ… ์‚ฌ์šฉ์ž ํ”„๋กœํ•„์˜ ๊ตญ์ /์–ธ์–ด ํ‘œ์‹œ
โœ… ๋‹ค๊ตญ์–ด ์„ค์ • ํŽ˜์ด์ง€

ํ•˜๋“œ์ฝ”๋”ฉ๋œ ๋ฒˆ์—ญ ๋ฐ์ดํ„ฐ๋ฅผ ์œ ์ง€ํ•  ํ•„์š”๊ฐ€ ์—†์–ด์„œ ์ •๋ง ํŽธํ•ด์š”! ๐ŸŽ‰
Korean ํ•œ๊ตญ์–ด English ์˜์–ด Japanese ๆ—ฅๆœฌ่ชž Chinese ไธญๆ–‡ Global Language Support

๐ŸŽฒ Intl.PluralRules - ๋ณต์ˆ˜ํ˜• ๊ทœ์น™ ์ฒ˜๋ฆฌ

์˜์–ด์—์„œ๋Š” "1 apple", "2 apples"์ฒ˜๋Ÿผ ๋ณต์ˆ˜ํ˜•์ด ๊ฐ„๋‹จํ•˜์ง€๋งŒ, ๋‹ค๋ฅธ ์–ธ์–ด๋“ค์€ ํ›จ์”ฌ ๋ณต์žกํ•ด์š”. ๋Ÿฌ์‹œ์•„์–ด๋Š” ๋ณต์ˆ˜ํ˜• ๊ทœ์น™์ด 3๊ฐ€์ง€๋‚˜ ๋˜๊ณ , ์•„๋ž์–ด๋Š” 6๊ฐ€์ง€๋‚˜ ๋ผ์š”! ๐Ÿ˜ต

// ์˜์–ด ๋ณต์ˆ˜ํ˜• ๊ทœ์น™
const prEn = new Intl.PluralRules('en-US');

console.log(prEn.select(0));    // other
console.log(prEn.select(1));    // one
console.log(prEn.select(2));    // other
console.log(prEn.select(5));    // other

// ํ•œ๊ตญ์–ด ๋ณต์ˆ˜ํ˜• ๊ทœ์น™ (ํ•ญ์ƒ other)
const prKo = new Intl.PluralRules('ko-KR');

console.log(prKo.select(0));    // other
console.log(prKo.select(1));    // other
console.log(prKo.select(2));    // other

// ๋Ÿฌ์‹œ์•„์–ด ๋ณต์ˆ˜ํ˜• ๊ทœ์น™ (๋ณต์žกํ•จ!)
const prRu = new Intl.PluralRules('ru-RU');

console.log(prRu.select(1));    // one
console.log(prRu.select(2));    // few
console.log(prRu.select(5));    // many
console.log(prRu.select(21));   // one

์‹ค์ „ ์˜ˆ์ œ: ๋™์  ๋ฉ”์‹œ์ง€ ์ƒ์„ฑ

function getItemMessage(count, locale = 'ko-KR') {
  const pr = new Intl.PluralRules(locale);
  const rule = pr.select(count);
  
  const messages = {
    'ko-KR': {
      other: `${count}๊ฐœ์˜ ํ•ญ๋ชฉ`
    },
    'en-US': {
      one: `${count} item`,
      other: `${count} items`
    },
    'ru-RU': {
      one: `${count} ะฟั€ะตะดะผะตั‚`,
      few: `${count} ะฟั€ะตะดะผะตั‚ะฐ`,
      many: `${count} ะฟั€ะตะดะผะตั‚ะพะฒ`
    }
  };
  
  return messages[locale][rule];
}

console.log(getItemMessage(1, 'en-US'));    // 1 item
console.log(getItemMessage(5, 'en-US'));    // 5 items
console.log(getItemMessage(1, 'ru-RU'));    // 1 ะฟั€ะตะดะผะตั‚
console.log(getItemMessage(2, 'ru-RU'));    // 2 ะฟั€ะตะดะผะตั‚ะฐ
console.log(getItemMessage(5, 'ru-RU'));    // 5 ะฟั€ะตะดะผะตั‚ะพะฒ
โš ๏ธ ๋ณต์ˆ˜ํ˜• ๊ทœ์น™์˜ ์ข…๋ฅ˜ โ€ข zero: 0๊ฐœ์ผ ๋•Œ (์•„๋ž์–ด ๋“ฑ)
โ€ข one: 1๊ฐœ์ผ ๋•Œ
โ€ข two: 2๊ฐœ์ผ ๋•Œ (์›จ์ผ์Šค์–ด ๋“ฑ)
โ€ข few: ์†Œ์ˆ˜์ผ ๋•Œ (๋Ÿฌ์‹œ์•„์–ด, ํด๋ž€๋“œ์–ด ๋“ฑ)
โ€ข many: ๋‹ค์ˆ˜์ผ ๋•Œ (๋Ÿฌ์‹œ์•„์–ด, ํด๋ž€๋“œ์–ด ๋“ฑ)
โ€ข other: ๊ทธ ์™ธ ๋ชจ๋“  ๊ฒฝ์šฐ

์–ธ์–ด๋งˆ๋‹ค ์‚ฌ์šฉํ•˜๋Š” ๊ทœ์น™์ด ๋‹ค๋ฅด๋‹ˆ ์ฃผ์˜ํ•˜์„ธ์š”!

๐ŸŒ Intl.Locale - ๋กœ์ผ€์ผ ์ •๋ณด ๊ด€๋ฆฌ

๋กœ์ผ€์ผ(Locale)์€ ์–ธ์–ด์™€ ์ง€์—ญ ์ •๋ณด๋ฅผ ๋‹ด๊ณ  ์žˆ๋Š” ์‹๋ณ„์ž์˜ˆ์š”. 'ko-KR'์€ ํ•œ๊ตญ์–ด-๋Œ€ํ•œ๋ฏผ๊ตญ, 'en-US'๋Š” ์˜์–ด-๋ฏธ๊ตญ์„ ์˜๋ฏธํ•˜์ฃ . Intl.Locale ๊ฐ์ฒด๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ด๋Ÿฐ ์ •๋ณด๋ฅผ ์‰ฝ๊ฒŒ ๋‹ค๋ฃฐ ์ˆ˜ ์žˆ์–ด์š”! ๐Ÿ—บ๏ธ

// ๋กœ์ผ€์ผ ๊ฐ์ฒด ์ƒ์„ฑ
const locale = new Intl.Locale('ko-KR');

console.log(locale.language);        // ko
console.log(locale.region);          // KR
console.log(locale.baseName);        // ko-KR

// ์˜ต์…˜๊ณผ ํ•จ๊ป˜ ์ƒ์„ฑ
const localeWithOptions = new Intl.Locale('ko-KR', {
  calendar: 'gregory',
  numberingSystem: 'latn',
  hourCycle: 'h23'
});

console.log(localeWithOptions.calendar);         // gregory
console.log(localeWithOptions.numberingSystem);  // latn
console.log(localeWithOptions.hourCycle);        // h23

// ์˜์–ด ๋กœ์ผ€์ผ
const enLocale = new Intl.Locale('en-US');
console.log(enLocale.language);      // en
console.log(enLocale.region);        // US

๋กœ์ผ€์ผ ์ •๋ณด ํ™•์žฅ

// ๊ธฐ๋ณธ ๋กœ์ผ€์ผ์—์„œ ํ™•์žฅ
const baseLocale = new Intl.Locale('ko');
const extendedLocale = new Intl.Locale(baseLocale, {
  region: 'KR',
  script: 'Hang'
});

console.log(extendedLocale.toString());  // ko-Hang-KR

// ๋‹ค์–‘ํ•œ ์†์„ฑ ํ™•์ธ
const detailedLocale = new Intl.Locale('zh-Hans-CN-u-ca-chinese-nu-hanidec');

console.log(detailedLocale.language);         // zh
console.log(detailedLocale.script);           // Hans
console.log(detailedLocale.region);           // CN
console.log(detailedLocale.calendar);         // chinese
console.log(detailedLocale.numberingSystem);  // hanidec

๐Ÿš€ ์‹ค์ „ ํ”„๋กœ์ ํŠธ: ๋‹ค๊ตญ์–ด ์‡ผํ•‘๋ชฐ ๋งŒ๋“ค๊ธฐ

์ž, ์ด์ œ ๋ฐฐ์šด ๊ฑธ ์ข…ํ•ฉํ•ด์„œ ์‹ค์ œ ํ”„๋กœ์ ํŠธ์— ์ ์šฉํ•ด๋ณผ๊นŒ์š”? ๊ฐ„๋‹จํ•œ ๋‹ค๊ตญ์–ด ์‡ผํ•‘๋ชฐ ์˜ˆ์ œ๋ฅผ ๋งŒ๋“ค์–ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค! ๐Ÿ›’

class MultilingualShop {
  constructor(locale = 'ko-KR') {
    this.locale = locale;
    this.currencyMap = {
      'ko-KR': 'KRW',
      'en-US': 'USD',
      'ja-JP': 'JPY',
      'de-DE': 'EUR'
    };
  }
  
  // ๊ฐ€๊ฒฉ ํ˜•์‹ํ™”
  formatPrice(price) {
    const currency = this.currencyMap[this.locale] || 'USD';
    const formatter = new Intl.NumberFormat(this.locale, {
      style: 'currency',
      currency: currency
    });
    return formatter.format(price);
  }
  
  // ๋‚ ์งœ ํ˜•์‹ํ™”
  formatDate(date) {
    const formatter = new Intl.DateTimeFormat(this.locale, {
      year: 'numeric',
      month: 'long',
      day: 'numeric'
    });
    return formatter.format(date);
  }
  
  // ๋ฐฐ์†ก ์˜ˆ์ •์ผ ํ‘œ์‹œ
  formatDeliveryTime(days) {
    const rtf = new Intl.RelativeTimeFormat(this.locale, {
      numeric: 'auto'
    });
    return rtf.format(days, 'day');
  }
  
  // ์žฌ๊ณ  ์ˆ˜๋Ÿ‰ ๋ฉ”์‹œ์ง€
  formatStockMessage(count) {
    const pr = new Intl.PluralRules(this.locale);
    const rule = pr.select(count);
    
    const messages = {
      'ko-KR': {
        other: `์žฌ๊ณ  ${count}๊ฐœ ๋‚จ์Œ`
      },
      'en-US': {
        one: `${count} item left`,
        other: `${count} items left`
      },
      'ja-JP': {
        other: `ๅœจๅบซ${count}ๅ€‹`
      }
    };
    
    return messages[this.locale]?.[rule] || `${count} items`;
  }
  
  // ์ƒํ’ˆ ์ •๋ณด ํ‘œ์‹œ
  displayProduct(product) {
    return {
      name: product.name,
      price: this.formatPrice(product.price),
      releaseDate: this.formatDate(product.releaseDate),
      delivery: this.formatDeliveryTime(product.deliveryDays),
      stock: this.formatStockMessage(product.stock)
    };
  }
}

// ์‚ฌ์šฉ ์˜ˆ์ œ
const product = {
  name: 'JavaScript ์™„๋ฒฝ ๊ฐ€์ด๋“œ',
  price: 35000,
  releaseDate: new Date('2024-01-15'),
  deliveryDays: 2,
  stock: 15
};

// ํ•œ๊ตญ์–ด ๋ฒ„์ „
const shopKo = new MultilingualShop('ko-KR');
console.log(shopKo.displayProduct(product));
/* ์ถœ๋ ฅ:
{
  name: 'JavaScript ์™„๋ฒฝ ๊ฐ€์ด๋“œ',
  price: 'โ‚ฉ35,000',
  releaseDate: '2024๋…„ 1์›” 15์ผ',
  delivery: '๋ชจ๋ ˆ',
  stock: '์žฌ๊ณ  15๊ฐœ ๋‚จ์Œ'
}
*/

// ์˜์–ด ๋ฒ„์ „
const shopEn = new MultilingualShop('en-US');
console.log(shopEn.displayProduct(product));
/* ์ถœ๋ ฅ:
{
  name: 'JavaScript ์™„๋ฒฝ ๊ฐ€์ด๋“œ',
  price: '$35,000.00',
  releaseDate: 'January 15, 2024',
  delivery: 'in 2 days',
  stock: '15 items left'
}
*/

// ์ผ๋ณธ์–ด ๋ฒ„์ „
const shopJp = new MultilingualShop('ja-JP');
console.log(shopJp.displayProduct(product));
/* ์ถœ๋ ฅ:
{
  name: 'JavaScript ์™„๋ฒฝ ๊ฐ€์ด๋“œ',
  price: 'ยฅ35,000',
  releaseDate: '2024ๅนด1ๆœˆ15ๆ—ฅ',
  delivery: '2ๆ—ฅๅพŒ',
  stock: 'ๅœจๅบซ15ๅ€‹'
}
*/
๐ŸŽ‰ ์™€์šฐ! ์ฝ”๋“œ ํ•œ ๋ฒˆ๋งŒ ์ž‘์„ฑํ•˜๋ฉด ์—ฌ๋Ÿฌ ์–ธ์–ด๋กœ ์ž๋™ ๋ณ€ํ™˜! ์ด๊ฒŒ ๋ฐ”๋กœ Intl ๊ฐ์ฒด์˜ ์ง„์ •ํ•œ ํž˜์ด์—์š”. ๊ฐ ์–ธ์–ด๋ณ„๋กœ ๋”ฐ๋กœ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•  ํ•„์š”๊ฐ€ ์—†์–ด์š”. ๋กœ์ผ€์ผ๋งŒ ๋ฐ”๊ฟ”์ฃผ๋ฉด ๋ชจ๋“  ๊ฒŒ ์ž๋™์œผ๋กœ ํ˜„์ง€ํ™”๋ฉ๋‹ˆ๋‹ค! ๐ŸŒŸ

๐Ÿ’ผ ์žฌ๋Šฅ๋„ท์—์„œ ๊ตญ์ œํ™” ๊ธฐ์ˆ  ๋ฐฐ์šฐ๊ณ  ๋‚˜๋ˆ„๊ธฐ

์—ฌ๋Ÿฌ๋ถ„, ์ด๋ ‡๊ฒŒ ๊ฐ•๋ ฅํ•œ ๊ตญ์ œํ™” ๊ธฐ์ˆ ์„ ๋ฐฐ์šฐ์…จ๋Š”๋ฐ, ํ˜น์‹œ ๋” ๊นŠ์ด ๊ณต๋ถ€ํ•˜๊ณ  ์‹ถ๊ฑฐ๋‚˜ ๋‹ค๋ฅธ ์‚ฌ๋žŒ๋“ค๊ณผ ์ง€์‹์„ ๋‚˜๋ˆ„๊ณ  ์‹ถ์œผ์‹ ๊ฐ€์š”? ๐Ÿค

์žฌ๋Šฅ๋„ท์€ ๋‹ค์–‘ํ•œ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์žฌ๋Šฅ์„ ๊ฑฐ๋ž˜ํ•˜๊ณ  ๊ณต์œ ํ•˜๋Š” ํ”Œ๋žซํผ์ด์—์š”. JavaScript ๊ตญ์ œํ™” ๊ฐ™์€ ์ „๋ฌธ ๊ธฐ์ˆ ์„ ๋ฐฐ์šฐ๊ณ  ์‹ถ๋‹ค๋ฉด, ์žฌ๋Šฅ๋„ท์—์„œ ์ „๋ฌธ๊ฐ€๋ฅผ ์ฐพ์•„๋ณผ ์ˆ˜ ์žˆ์–ด์š”. ๋ฐ˜๋Œ€๋กœ ์—ฌ๋Ÿฌ๋ถ„์ด ์ด ๋ถ„์•ผ์— ์ž์‹  ์žˆ๋‹ค๋ฉด, ์žฌ๋Šฅ๋„ท์„ ํ†ตํ•ด ๋‹ค๋ฅธ ๊ฐœ๋ฐœ์ž๋“ค์—๊ฒŒ ๊ฐ€๋ฅด์ณ์ฃผ๋Š” ๊ฒƒ๋„ ์ข‹์€ ๋ฐฉ๋ฒ•์ด์ฃ ! ๐Ÿ’ก

ํŠนํžˆ ์‹ค๋ฌด์—์„œ ๋‹ค๊ตญ์–ด ์›น์‚ฌ์ดํŠธ๋ฅผ ๊ฐœ๋ฐœํ•ด๋ณธ ๊ฒฝํ—˜์ด ์žˆ๋‹ค๋ฉด, ๊ทธ ๋…ธํ•˜์šฐ๋ฅผ ๋‚˜๋ˆ„๋Š” ๊ฒƒ๋งŒ์œผ๋กœ๋„ ๋งŽ์€ ์‚ฌ๋žŒ๋“ค์—๊ฒŒ ๋„์›€์ด ๋  ๊ฑฐ์˜ˆ์š”. ํ•จ๊ป˜ ์„ฑ์žฅํ•˜๋Š” ๊ฐœ๋ฐœ์ž ์ปค๋ฎค๋‹ˆํ‹ฐ, ๋ฉ‹์ง€์ง€ ์•Š๋‚˜์š”? ๐Ÿ˜Š

๐ŸŽฏ ์„ฑ๋Šฅ ์ตœ์ ํ™” ํŒ

Intl ๊ฐ์ฒด๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ ์„ฑ๋Šฅ์„ ๊ณ ๋ คํ•˜๋Š” ๊ฒƒ๋„ ์ค‘์š”ํ•ด์š”. ๋ช‡ ๊ฐ€์ง€ ํŒ์„ ์•Œ๋ ค๋“œ๋ฆด๊ฒŒ์š”! โšก

1. ํฌ๋งทํ„ฐ ์žฌ์‚ฌ์šฉํ•˜๊ธฐ

// โŒ ๋‚˜์œ ์˜ˆ: ๋งค๋ฒˆ ์ƒˆ๋กœ ์ƒ์„ฑ
function formatPrices(prices) {
  return prices.map(price => {
    const formatter = new Intl.NumberFormat('ko-KR', {
      style: 'currency',
      currency: 'KRW'
    });
    return formatter.format(price);
  });
}

// โœ… ์ข‹์€ ์˜ˆ: ํ•œ ๋ฒˆ๋งŒ ์ƒ์„ฑํ•˜๊ณ  ์žฌ์‚ฌ์šฉ
function formatPricesOptimized(prices) {
  const formatter = new Intl.NumberFormat('ko-KR', {
    style: 'currency',
    currency: 'KRW'
  });
  return prices.map(price => formatter.format(price));
}

// ์„ฑ๋Šฅ ๋น„๊ต
const prices = Array.from({ length: 1000 }, (_, i) => i * 1000);

console.time('๋‚˜์œ ์˜ˆ');
formatPrices(prices);
console.timeEnd('๋‚˜์œ ์˜ˆ');

console.time('์ข‹์€ ์˜ˆ');
formatPricesOptimized(prices);
console.timeEnd('์ข‹์€ ์˜ˆ');
// ์ข‹์€ ์˜ˆ๊ฐ€ ํ›จ์”ฌ ๋น ๋ฆ…๋‹ˆ๋‹ค!

2. ์‹ฑ๊ธ€ํ†ค ํŒจํ„ด ํ™œ์šฉ

// ํฌ๋งทํ„ฐ ์บ์‹ฑ ํด๋ž˜์Šค
class FormatterCache {
  constructor() {
    this.cache = new Map();
  }
  
  getNumberFormatter(locale, options) {
    const key = `${locale}-${JSON.stringify(options)}`;
    
    if (!this.cache.has(key)) {
      this.cache.set(
        key,
        new Intl.NumberFormat(locale, options)
      );
    }
    
    return this.cache.get(key);
  }
  
  getDateFormatter(locale, options) {
    const key = `date-${locale}-${JSON.stringify(options)}`;
    
    if (!this.cache.has(key)) {
      this.cache.set(
        key,
        new Intl.DateTimeFormat(locale, options)
      );
    }
    
    return this.cache.get(key);
  }
}

// ์ „์—ญ ์ธ์Šคํ„ด์Šค
const formatterCache = new FormatterCache();

// ์‚ฌ์šฉ
function formatPrice(price, locale = 'ko-KR') {
  const formatter = formatterCache.getNumberFormatter(locale, {
    style: 'currency',
    currency: 'KRW'
  });
  return formatter.format(price);
}

function formatDate(date, locale = 'ko-KR') {
  const formatter = formatterCache.getDateFormatter(locale, {
    year: 'numeric',
    month: 'long',
    day: 'numeric'
  });
  return formatter.format(date);
}
๐Ÿ’ก ์„ฑ๋Šฅ ์ตœ์ ํ™” ํ•ต์‹ฌ ํฌ์ธํŠธ
  • โœ… Intl ๊ฐ์ฒด ์ƒ์„ฑ์€ ๋น„์šฉ์ด ํฐ ์ž‘์—…์ด์—์š”
  • โœ… ๊ฐ€๋Šฅํ•œ ํ•œ ์žฌ์‚ฌ์šฉํ•˜์„ธ์š”
  • โœ… ์บ์‹ฑ์„ ํ™œ์šฉํ•˜๋ฉด ์„ฑ๋Šฅ์ด ํฌ๊ฒŒ ํ–ฅ์ƒ๋ผ์š”
  • โœ… ํŠนํžˆ ๋ฐ˜๋ณต๋ฌธ ์•ˆ์—์„œ๋Š” ์ ˆ๋Œ€ ๋งค๋ฒˆ ์ƒ์„ฑํ•˜์ง€ ๋งˆ์„ธ์š”!

๐Ÿ› ํ”ํ•œ ์‹ค์ˆ˜์™€ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

์‹ค๋ฌด์—์„œ ์ž์ฃผ ๋ฐœ์ƒํ•˜๋Š” ์‹ค์ˆ˜๋“ค์„ ์ •๋ฆฌํ•ด๋ดค์–ด์š”. ๋ฏธ๋ฆฌ ์•Œ๊ณ  ์žˆ์œผ๋ฉด ์‚ฝ์งˆ์„ ์ค„์ผ ์ˆ˜ ์žˆ์–ด์š”! ๐Ÿ˜…

1. ์ž˜๋ชป๋œ ๋กœ์ผ€์ผ ์ฝ”๋“œ ์‚ฌ์šฉ

// โŒ ์ž˜๋ชป๋œ ์˜ˆ
try {
  const formatter = new Intl.NumberFormat('korean');
  // RangeError: Invalid language tag: korean
} catch (e) {
  console.error(e);
}

// โœ… ์˜ฌ๋ฐ”๋ฅธ ์˜ˆ
const formatter = new Intl.NumberFormat('ko-KR');

// ๋กœ์ผ€์ผ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ
function isValidLocale(locale) {
  try {
    new Intl.NumberFormat(locale);
    return true;
  } catch (e) {
    return false;
  }
}

console.log(isValidLocale('ko-KR'));    // true
console.log(isValidLocale('korean'));   // false

2. ํ†ตํ™” ์ฝ”๋“œ ๋ˆ„๋ฝ

// โŒ ์—๋Ÿฌ ๋ฐœ์ƒ
try {
  const formatter = new Intl.NumberFormat('ko-KR', {
    style: 'currency'
    // currency ์˜ต์…˜์ด ์—†์Œ!
  });
} catch (e) {
  console.error(e);
  // TypeError: Currency code is required with currency style.
}

// โœ… ์˜ฌ๋ฐ”๋ฅธ ์˜ˆ
const formatter = new Intl.NumberFormat('ko-KR', {
  style: 'currency',
  currency: 'KRW'  // ๋ฐ˜๋“œ์‹œ ํ•„์š”!
});

3. ํƒ€์ž„์กด ์ฒ˜๋ฆฌ ์‹ค์ˆ˜

// ์„œ๋ฒ„์—์„œ ๋ฐ›์€ UTC ์‹œ๊ฐ„
const utcDate = new Date('2024-01-15T14:30:00Z');

// โŒ ๋กœ์ปฌ ์‹œ๊ฐ„์œผ๋กœ ํ‘œ์‹œ๋จ
const formatter1 = new Intl.DateTimeFormat('ko-KR', {
  year: 'numeric',
  month: '2-digit',
  day: '2-digit',
  hour: '2-digit',
  minute: '2-digit'
});
console.log(formatter1.format(utcDate));
// ์ถœ๋ ฅ: 2024. 01. 15. 23:30 (ํ•œ๊ตญ ์‹œ๊ฐ„์œผ๋กœ ๋ณ€ํ™˜๋จ)

// โœ… ํŠน์ • ํƒ€์ž„์กด์œผ๋กœ ํ‘œ์‹œ
const formatter2 = new Intl.DateTimeFormat('ko-KR', {
  year: 'numeric',
  month: '2-digit',
  day: '2-digit',
  hour: '2-digit',
  minute: '2-digit',
  timeZone: 'UTC'  // UTC๋กœ ๊ณ ์ •
});
console.log(formatter2.format(utcDate));
// ์ถœ๋ ฅ: 2024. 01. 15. 14:30

// ๋‹ค๋ฅธ ํƒ€์ž„์กด์œผ๋กœ ํ‘œ์‹œ
const formatter3 = new Intl.DateTimeFormat('ko-KR', {
  year: 'numeric',
  month: '2-digit',
  day: '2-digit',
  hour: '2-digit',
  minute: '2-digit',
  timeZone: 'America/New_York'
});
console.log(formatter3.format(utcDate));
// ์ถœ๋ ฅ: 2024. 01. 15. 09:30 (๋‰ด์š• ์‹œ๊ฐ„)

4. ๋ธŒ๋ผ์šฐ์ € ํ˜ธํ™˜์„ฑ ๋ฏธํ™•์ธ

// ๊ธฐ๋Šฅ ์ง€์› ์—ฌ๋ถ€ ํ™•์ธ
function checkIntlSupport() {
  const support = {
    DateTimeFormat: typeof Intl.DateTimeFormat !== 'undefined',
    NumberFormat: typeof Intl.NumberFormat !== 'undefined',
    Collator: typeof Intl.Collator !== 'undefined',
    PluralRules: typeof Intl.PluralRules !== 'undefined',
    RelativeTimeFormat: typeof Intl.RelativeTimeFormat !== 'undefined',
    ListFormat: typeof Intl.ListFormat !== 'undefined',
    DisplayNames: typeof Intl.DisplayNames !== 'undefined'
  };
  
  return support;
}

const support = checkIntlSupport();
console.log(support);

// ํด๋ฐฑ ์ฒ˜๋ฆฌ
function formatPrice(price, locale = 'ko-KR') {
  if (typeof Intl.NumberFormat !== 'undefined') {
    const formatter = new Intl.NumberFormat(locale, {
      style: 'currency',
      currency: 'KRW'
    });
    return formatter.format(price);
  } else {
    // ํด๋ฐฑ: ๊ฐ„๋‹จํ•œ ํ˜•์‹
    return `โ‚ฉ${price.toLocaleString()}`;
  }
}
โš ๏ธ ๋ธŒ๋ผ์šฐ์ € ํ˜ธํ™˜์„ฑ ์ฃผ์˜! โ€ข DateTimeFormat, NumberFormat, Collator: ๊ฑฐ์˜ ๋ชจ๋“  ์ตœ์‹  ๋ธŒ๋ผ์šฐ์ € ์ง€์›
โ€ข PluralRules, RelativeTimeFormat: Chrome 63+, Firefox 58+, Safari 13+
โ€ข ListFormat: Chrome 72+, Firefox 78+, Safari 14.1+
โ€ข DisplayNames: Chrome 81+, Firefox 86+, Safari 14.1+

๊ตฌํ˜• ๋ธŒ๋ผ์šฐ์ €๋ฅผ ์ง€์›ํ•ด์•ผ ํ•œ๋‹ค๋ฉด ํด๋ฆฌํ•„(polyfill)์„ ์‚ฌ์šฉํ•˜๊ฑฐ๋‚˜ ํด๋ฐฑ ๋กœ์ง์„ ๊ตฌํ˜„ํ•˜์„ธ์š”!
โœ— Common Mistakes โœ“ Best Practices Learn from Mistakes

๐ŸŒŸ ์‹ค์ „ ํ™œ์šฉ ์‚ฌ๋ก€

์ด๋ก ์€ ์ถฉ๋ถ„ํžˆ ๋ฐฐ์› ์œผ๋‹ˆ, ์ด์ œ ์‹ค์ œ๋กœ ์–ด๋–ป๊ฒŒ ํ™œ์šฉ๋˜๋Š”์ง€ ๊ตฌ์ฒด์ ์ธ ์˜ˆ์ œ๋“ค์„ ์‚ดํŽด๋ณผ๊นŒ์š”? ๐Ÿ’ผ

์‚ฌ๋ก€ 1: ๋‹ค๊ตญ์–ด ๋ธ”๋กœ๊ทธ ์‹œ์Šคํ…œ

class BlogPost {
  constructor(locale = 'ko-KR') {
    this.locale = locale;
    this.dateFormatter = new Intl.DateTimeFormat(locale, {
      year: 'numeric',
      month: 'long',
      day: 'numeric'
    });
    this.rtf = new Intl.RelativeTimeFormat(locale, {
      numeric: 'auto'
    });
  }
  
  formatPublishDate(date) {
    return this.dateFormatter.format(date);
  }
  
  getTimeAgo(date) {
    const now = new Date();
    const diffInSeconds = Math.floor((date - now) / 1000);
    const diffInMinutes = Math.floor(diffInSeconds / 60);
    const diffInHours = Math.floor(diffInMinutes / 60);
    const diffInDays = Math.floor(diffInHours / 24);
    
    if (Math.abs(diffInDays) > 0) {
      return this.rtf.format(diffInDays, 'day');
    } else if (Math.abs(diffInHours) > 0) {
      return this.rtf.format(diffInHours, 'hour');
    } else if (Math.abs(diffInMinutes) > 0) {
      return this.rtf.format(diffInMinutes, 'minute');
    } else {
      return this.rtf.format(diffInSeconds, 'second');
    }
  }
  
  formatReadingTime(minutes) {
    const pr = new Intl.PluralRules(this.locale);
    const rule = pr.select(minutes);
    
    const messages = {
      'ko-KR': {
        other: `${minutes}๋ถ„ ์†Œ์š”`
      },
      'en-US': {
        one: `${minutes} minute read`,
        other: `${minutes} minutes read`
      },
      'ja-JP': {
        other: `${minutes}ๅˆ†ใง่ชญใ‚ใพใ™`
      }
    };
    
    return messages[this.locale]?.[rule] || `${minutes} min`;
  }
  
  render(post) {
    return {
      title: post.title,
      publishDate: this.formatPublishDate(post.publishDate),
      timeAgo: this.getTimeAgo(post.publishDate),
      readingTime: this.formatReadingTime(post.readingMinutes),
      views: this.formatViews(post.views)
    };
  }
  
  formatViews(count) {
    const formatter = new Intl.NumberFormat(this.locale, {
      notation: 'compact',
      compactDisplay: 'short'
    });
    return formatter.format(count);
  }
}

// ์‚ฌ์šฉ ์˜ˆ์ œ
const post = {
  title: 'JavaScript ๊ตญ์ œํ™” ์™„๋ฒฝ ๊ฐ€์ด๋“œ',
  publishDate: new Date('2024-01-10'),
  readingMinutes: 15,
  views: 12500
};

const blogKo = new BlogPost('ko-KR');
console.log(blogKo.render(post));
/* ์ถœ๋ ฅ:
{
  title: 'JavaScript ๊ตญ์ œํ™” ์™„๋ฒฝ ๊ฐ€์ด๋“œ',
  publishDate: '2024๋…„ 1์›” 10์ผ',
  timeAgo: '5์ผ ์ „',
  readingTime: '15๋ถ„ ์†Œ์š”',
  views: '1.3๋งŒ'
}
*/

const blogEn = new BlogPost('en-US');
console.log(blogEn.render(post));
/* ์ถœ๋ ฅ:
{
  title: 'JavaScript ๊ตญ์ œํ™” ์™„๋ฒฝ ๊ฐ€์ด๋“œ',
  publishDate: 'January 10, 2024',
  timeAgo: '5 days ago',
  readingTime: '15 minutes read',
  views: '13K'
}
*/

์‚ฌ๋ก€ 2: ๋‹ค๊ตญ์–ด ๋Œ€์‹œ๋ณด๋“œ

class Dashboard {
  constructor(locale = 'ko-KR') {
    this.locale = locale;
    this.currency = this.getCurrencyForLocale(locale);
  }
  
  getCurrencyForLocale(locale) {
    const currencyMap = {
      'ko-KR': 'KRW',
      'en-US': 'USD',
      'ja-JP': 'JPY',
      'de-DE': 'EUR',
      'en-GB': 'GBP'
    };
    return currencyMap[locale] || 'USD';
  }
  
  formatRevenue(amount) {
    const formatter = new Intl.NumberFormat(this.locale, {
      style: 'currency',
      currency: this.currency,
      notation: 'compact',
      maximumFractionDigits: 1
    });
    return formatter.format(amount);
  }
  
  formatPercentage(value) {
    const formatter = new Intl.NumberFormat(this.locale, {
      style: 'percent',
      minimumFractionDigits: 1,
      maximumFractionDigits: 1,
      signDisplay: 'exceptZero'
    });
    return formatter.format(value);
  }
  
  formatUserCount(count) {
    const formatter = new Intl.NumberFormat(this.locale, {
      notation: 'compact',
      compactDisplay: 'short'
    });
    return formatter.format(count);
  }
  
  formatGrowthRate(current, previous) {
    const growth = (current - previous) / previous;
    return this.formatPercentage(growth);
  }
  
  renderStats(data) {
    return {
      revenue: this.formatRevenue(data.revenue),
      revenueGrowth: this.formatGrowthRate(data.revenue, data.previousRevenue),
      users: this.formatUserCount(data.users),
      userGrowth: this.formatGrowthRate(data.users, data.previousUsers),
      conversionRate: this.formatPercentage(data.conversionRate)
    };
  }
}

// ์‚ฌ์šฉ ์˜ˆ์ œ
const dashboardData = {
  revenue: 5420000,
  previousRevenue: 4800000,
  users: 125000,
  previousUsers: 98000,
  conversionRate: 0.0342
};

const dashKo = new Dashboard('ko-KR');
console.log(dashKo.renderStats(dashboardData));
/* ์ถœ๋ ฅ:
{
  revenue: 'โ‚ฉ542๋งŒ',
  revenueGrowth: '+12.9%',
  users: '13๋งŒ',
  userGrowth: '+27.6%',
  conversionRate: '3.4%'
}
*/

const dashEn = new Dashboard('en-US');
console.log(dashEn.renderStats(dashboardData));
/* ์ถœ๋ ฅ:
{
  revenue: '$5.4M',
  revenueGrowth: '+12.9%',
  users: '125K',
  userGrowth: '+27.6%',
  conversionRate: '3.4%'
}
*/

์‚ฌ๋ก€ 3: ์ด๋ฒคํŠธ ์˜ˆ์•ฝ ์‹œ์Šคํ…œ

class EventBooking {
  constructor(locale = 'ko-KR', timeZone = 'Asia/Seoul') {
    this.locale = locale;
    this.timeZone = timeZone;
  }
  
  formatEventDate(date) {
    const formatter = new Intl.DateTimeFormat(this.locale, {
      weekday: 'long',
      year: 'numeric',
      month: 'long',
      day: 'numeric',
      hour: '2-digit',
      minute: '2-digit',
      timeZone: this.timeZone,
      timeZoneName: 'short'
    });
    return formatter.format(date);
  }
  
  formatDuration(minutes) {
    const hours = Math.floor(minutes / 60);
    const mins = minutes % 60;
    
    const parts = [];
    if (hours > 0) {
      const hourFormatter = new Intl.NumberFormat(this.locale, {
        style: 'unit',
        unit: 'hour',
        unitDisplay: 'long'
      });
      parts.push(hourFormatter.format(hours));
    }
    if (mins > 0) {
      const minFormatter = new Intl.NumberFormat(this.locale, {
        style: 'unit',
        unit: 'minute',
        unitDisplay: 'long'
      });
      parts.push(minFormatter.format(mins));
    }
    
    const listFormatter = new Intl.ListFormat(this.locale, {
      style: 'long',
      type: 'conjunction'
    });
    return listFormatter.format(parts);
  }
  
  formatAttendees(names) {
    const listFormatter = new Intl.ListFormat(this.locale, {
      style: 'long',
      type: 'conjunction'
    });
    return listFormatter.format(names);
  }
  
  formatPrice(price) {
    const currencyMap = {
      'ko-KR': 'KRW',
      'en-US': 'USD',
      'ja-JP': 'JPY'
    };
    const currency = currencyMap[this.locale] || 'USD';
    
    const formatter = new Intl.NumberFormat(this.locale, {
      style: 'currency',
      currency: currency
    });
    return formatter.format(price);
  }
  
  renderEvent(event) {
    return {
      title: event.title,
      date: this.formatEventDate(event.date),
      duration: this.formatDuration(event.durationMinutes),
      attendees: this.formatAttendees(event.attendees),
      price: this.formatPrice(event.price)
    };
  }
}

// ์‚ฌ์šฉ ์˜ˆ์ œ
const event = {
  title: 'JavaScript ๊ตญ์ œํ™” ์›Œํฌ์ƒต',
  date: new Date('2024-02-15T14:00:00'),
  durationMinutes: 150,
  attendees: ['๊น€์ฒ ์ˆ˜', '์ด์˜ํฌ', '๋ฐ•๋ฏผ์ˆ˜'],
  price: 50000
};

const bookingKo = new EventBooking('ko-KR', 'Asia/Seoul');
console.log(bookingKo.renderEvent(event));
/* ์ถœ๋ ฅ:
{
  title: 'JavaScript ๊ตญ์ œํ™” ์›Œํฌ์ƒต',
  date: '2024๋…„ 2์›” 15์ผ ๋ชฉ์š”์ผ ์˜คํ›„ 2:00 GMT+9',
  duration: '2์‹œ๊ฐ„ ๋ฐ 30๋ถ„',
  attendees: '๊น€์ฒ ์ˆ˜, ์ด์˜ํฌ ๋ฐ ๋ฐ•๋ฏผ์ˆ˜',
  price: 'โ‚ฉ50,000'
}
*/

const bookingEn = new EventBooking('en-US', 'America/New_York');
console.log(bookingEn.renderEvent(event));
/* ์ถœ๋ ฅ:
{
  title: 'JavaScript ๊ตญ์ œํ™” ์›Œํฌ์ƒต',
  date: 'Thursday, February 15, 2024 at 12:00 AM EST',
  duration: '2 hours and 30 minutes',
  attendees: '๊น€์ฒ ์ˆ˜, ์ด์˜ํฌ, and ๋ฐ•๋ฏผ์ˆ˜',
  price: '$50,000.00'
}
*/
๐ŸŽฏ ์‹ค์ „ ํŒ ์ •๋ฆฌ 1๏ธโƒฃ ์ผ๊ด€์„ฑ ์œ ์ง€: ์•ฑ ์ „์ฒด์—์„œ ๊ฐ™์€ ๋กœ์ผ€์ผ ์„ค์ • ์‚ฌ์šฉ
2๏ธโƒฃ ์‚ฌ์šฉ์ž ์„ ํ˜ธ๋„ ์กด์ค‘: ๋ธŒ๋ผ์šฐ์ € ์„ค์ •์„ ๊ธฐ๋ณธ๊ฐ’์œผ๋กœ ์‚ฌ์šฉ
3๏ธโƒฃ ํƒ€์ž„์กด ๋ช…์‹œ: ๋‚ ์งœ/์‹œ๊ฐ„ ํ‘œ์‹œ ์‹œ ํƒ€์ž„์กด ์ •๋ณด ํฌํ•จ
4๏ธโƒฃ ํด๋ฐฑ ์ œ๊ณต: ์ง€์›ํ•˜์ง€ ์•Š๋Š” ๋กœ์ผ€์ผ์— ๋Œ€ํ•œ ๋Œ€๋น„์ฑ… ๋งˆ๋ จ
5๏ธโƒฃ ํ…Œ์ŠคํŠธ ์ฒ ์ €ํžˆ: ๋‹ค์–‘ํ•œ ๋กœ์ผ€์ผ์—์„œ ํ…Œ์ŠคํŠธ ํ•„์ˆ˜!

๐Ÿ”ง ์œ ์šฉํ•œ ํ—ฌํผ ํ•จ์ˆ˜ ๋ชจ์Œ

์‹ค๋ฌด์—์„œ ์ž์ฃผ ์‚ฌ์šฉํ•˜๋Š” ์œ ํ‹ธ๋ฆฌํ‹ฐ ํ•จ์ˆ˜๋“ค์„ ๋ชจ์•„๋ดค์–ด์š”. ๋ณต์‚ฌํ•ด์„œ ๋ฐ”๋กœ ์‚ฌ์šฉํ•˜์…”๋„ ์ข‹์•„์š”! ๐Ÿ“‹

// ๊ตญ์ œํ™” ์œ ํ‹ธ๋ฆฌํ‹ฐ ํด๋ž˜์Šค
class I18nUtils {
  // ์‚ฌ์šฉ์ž ๋กœ์ผ€์ผ ๊ฐ์ง€
  static getUserLocale() {
    return navigator.language || 
           navigator.userLanguage || 
           'en-US';
  }
  
  // ๋กœ์ผ€์ผ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ
  static isValidLocale(locale) {
    try {
      new Intl.DateTimeFormat(locale);
      return true;
    } catch {
      return false;
    }
  }
  
  // ์ง€์› ๊ฐ€๋Šฅํ•œ ๋กœ์ผ€์ผ ์ฐพ๊ธฐ
  static getSupportedLocale(requestedLocales, availableLocales) {
    const requested = Array.isArray(requestedLocales) 
      ? requestedLocales 
      : [requestedLocales];
    
    for (const locale of requested) {
      if (availableLocales.includes(locale)) {
        return locale;
      }
      
      // ์–ธ์–ด ์ฝ”๋“œ๋งŒ ๋งค์นญ ์‹œ๋„ (ko-KR -> ko)
      const language = locale.split('-')[0];
      const match = availableLocales.find(
        available => available.startsWith(language)
      );
      if (match) return match;
    }
    
    return availableLocales[0]; // ๊ธฐ๋ณธ๊ฐ’
  }
  
  // ์ˆซ์ž๋ฅผ ์ฝ๊ธฐ ์‰ฌ์šด ํ˜•ํƒœ๋กœ
  static formatCompactNumber(number, locale = 'ko-KR') {
    return new Intl.NumberFormat(locale, {
      notation: 'compact',
      compactDisplay: 'short'
    }).format(number);
  }
  
  // ํŒŒ์ผ ํฌ๊ธฐ ํ˜•์‹ํ™”
  static formatFileSize(bytes, locale = 'ko-KR') {
    const units = ['byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte'];
    let size = bytes;
    let unitIndex = 0;
    
    while (size >= 1024 && unitIndex < units.length - 1) {
      size /= 1024;
      unitIndex++;
    }
    
    return new Intl.NumberFormat(locale, {
      style: 'unit',
      unit: units[unitIndex],
      unitDisplay: 'short',
      maximumFractionDigits: 2
    }).format(size);
  }
  
  // ๋‚ ์งœ ๋ฒ”์œ„ ํ˜•์‹ํ™”
  static formatDateRange(startDate, endDate, locale = 'ko-KR') {
    const formatter = new Intl.DateTimeFormat(locale, {
      year: 'numeric',
      month: 'long',
      day: 'numeric'
    });
    
    return formatter.formatRange(startDate, endDate);
  }
  
  // ํ†ตํ™” ๋ณ€ํ™˜ ๋ฐ ํ˜•์‹ํ™”
  static formatCurrency(amount, fromCurrency, toCurrency, locale = 'ko-KR') {
    // ์‹ค์ œ๋กœ๋Š” ํ™˜์œจ API๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค
    // ์—ฌ๊ธฐ์„œ๋Š” ์˜ˆ์‹œ๋กœ ๊ฐ„๋‹จํžˆ ๊ตฌํ˜„
    const formatter = new Intl.NumberFormat(locale, {
      style: 'currency',
      currency: toCurrency
    });
    
    return formatter.format(amount);
  }
  
  // ์ƒ๋Œ€ ์‹œ๊ฐ„ (์Šค๋งˆํŠธ ๋ฒ„์ „)
  static formatSmartRelativeTime(date, locale = 'ko-KR') {
    const now = new Date();
    const diff = date - now;
    const absDiff = Math.abs(diff);
    
    const minute = 60 * 1000;
    const hour = 60 * minute;
    const day = 24 * hour;
    const week = 7 * day;
    const month = 30 * day;
    const year = 365 * day;
    
    const rtf = new Intl.RelativeTimeFormat(locale, { numeric: 'auto' });
    
    if (absDiff < minute) {
      return rtf.format(Math.round(diff / 1000), 'second');
    } else if (absDiff < hour) {
      return rtf.format(Math.round(diff / minute), 'minute');
    } else if (absDiff < day) {
      return rtf.format(Math.round(diff / hour), 'hour');
    } else if (absDiff < week) {
      return rtf.format(Math.round(diff / day), 'day');
    } else if (absDiff < month) {
      return rtf.format(Math.round(diff / week), 'week');
    } else if (absDiff < year) {
      return rtf.format(Math.round(diff / month), 'month');
    } else {
      return rtf.format(Math.round(diff / year), 'year');
    }
  }
  
  // ์ •๋ ฌ ํ•จ์ˆ˜ ์ƒ์„ฑ
  static createSorter(locale = 'ko-KR', options = {}) {
    const collator = new Intl.Collator(locale, options);
    return (a, b) => collator.compare(a, b);
  }
}

// ์‚ฌ์šฉ ์˜ˆ์ œ
console.log(I18nUtils.getUserLocale());
// ์ถœ๋ ฅ: ko-KR (์‚ฌ์šฉ์ž ๋ธŒ๋ผ์šฐ์ € ์„ค์ •์— ๋”ฐ๋ผ)

console.log(I18nUtils.formatCompactNumber(1234567));
// ์ถœ๋ ฅ: 123๋งŒ

console.log(I18nUtils.formatFileSize(1536000));
// ์ถœ๋ ฅ: 1.46MB

const start = new Date('2024-01-15');
const end = new Date('2024-01-20');
console.log(I18nUtils.formatDateRange(start, end));
// ์ถœ๋ ฅ: 2024๋…„ 1์›” 15์ผ~20์ผ

const pastDate = new Date(Date.now() - 2 * 60 * 60 * 1000);
console.log(I18nUtils.formatSmartRelativeTime(pastDate));
// ์ถœ๋ ฅ: 2์‹œ๊ฐ„ ์ „

const names = ['์ตœ์ง€ํ›ˆ', '๊น€์ฒ ์ˆ˜', '์ด์˜ํฌ', '๋ฐ•๋ฏผ์ˆ˜'];
const sorter = I18nUtils.createSorter('ko-KR');
console.log(names.sort(sorter));
// ์ถœ๋ ฅ: ['๊น€์ฒ ์ˆ˜', '๋ฐ•๋ฏผ์ˆ˜', '์ด์˜ํฌ', '์ตœ์ง€ํ›ˆ']

๐ŸŽ“ ํ•™์Šต ๋กœ๋“œ๋งต๊ณผ ์ถ”๊ฐ€ ๋ฆฌ์†Œ์Šค

์—ฌ๊ธฐ๊นŒ์ง€ ์˜ค์‹œ๋А๋ผ ์ˆ˜๊ณ  ๋งŽ์œผ์…จ์–ด์š”! ๐ŸŽ‰ ์ด์ œ ์–ด๋–ป๊ฒŒ ๋” ๊ณต๋ถ€ํ•˜๋ฉด ์ข‹์„์ง€ ๋กœ๋“œ๋งต์„ ์•Œ๋ ค๋“œ๋ฆด๊ฒŒ์š”.

๐Ÿ“š ํ•™์Šต ๋‹จ๊ณ„๋ณ„ ๊ฐ€์ด๋“œ ๐ŸŒฑ ์ดˆ๊ธ‰ (1-2์ฃผ)
โ€ข Intl.DateTimeFormat ๊ธฐ๋ณธ ์‚ฌ์šฉ๋ฒ• ๋งˆ์Šคํ„ฐ
โ€ข Intl.NumberFormat์œผ๋กœ ์ˆซ์ž/ํ†ตํ™” ํ˜•์‹ํ™”
โ€ข ๋กœ์ผ€์ผ ๊ฐœ๋… ์ดํ•ดํ•˜๊ธฐ
โ€ข ๊ฐ„๋‹จํ•œ ๋‹ค๊ตญ์–ด ํŽ˜์ด์ง€ ๋งŒ๋“ค์–ด๋ณด๊ธฐ

๐ŸŒฟ ์ค‘๊ธ‰ (2-4์ฃผ)
โ€ข Intl.RelativeTimeFormat ํ™œ์šฉ
โ€ข Intl.ListFormat๊ณผ Intl.DisplayNames ์‚ฌ์šฉ
โ€ข ์„ฑ๋Šฅ ์ตœ์ ํ™” ๊ธฐ๋ฒ• ์ ์šฉ
โ€ข ์‹ค์ œ ํ”„๋กœ์ ํŠธ์— ์ ์šฉํ•ด๋ณด๊ธฐ

๐ŸŒณ ๊ณ ๊ธ‰ (4์ฃผ ์ด์ƒ)
โ€ข Intl.Collator๋กœ ๋ณต์žกํ•œ ์ •๋ ฌ ๊ตฌํ˜„
โ€ข Intl.PluralRules๋กœ ๋‹ค๊ตญ์–ด ๋ฉ”์‹œ์ง€ ์‹œ์Šคํ…œ ๊ตฌ์ถ•
โ€ข ํƒ€์ž„์กด ์ฒ˜๋ฆฌ ์™„๋ฒฝ ์ดํ•ด
โ€ข ๋Œ€๊ทœ๋ชจ ๋‹ค๊ตญ์–ด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์„ค๊ณ„

์ถ”์ฒœ ํ•™์Šต ์ž๋ฃŒ

๐Ÿ“– ๊ณต์‹ ๋ฌธ์„œ โ€ข MDN Web Docs - Intl
โ€ข ECMAScript Internationalization API Specification
โ€ข Unicode CLDR (Common Locale Data Repository)

๐Ÿ› ๏ธ ์œ ์šฉํ•œ ๋„๊ตฌ
โ€ข BCP 47 Language Tag Lookup
โ€ข IANA Time Zone Database
โ€ข ISO 4217 Currency Codes

๐Ÿ’ป ์‹ค์Šต ํ”„๋กœ์ ํŠธ ์•„์ด๋””์–ด
โ€ข ๋‹ค๊ตญ์–ด ๋ธ”๋กœ๊ทธ ํ”Œ๋žซํผ
โ€ข ๊ตญ์ œ ์ „์ž์ƒ๊ฑฐ๋ž˜ ์‚ฌ์ดํŠธ
โ€ข ๊ธ€๋กœ๋ฒŒ ์ด๋ฒคํŠธ ์˜ˆ์•ฝ ์‹œ์Šคํ…œ
โ€ข ๋‹ค๊ตญ์–ด ๋Œ€์‹œ๋ณด๋“œ
โ€ข ๊ตญ์ œ ๊ธˆ์œต ๊ณ„์‚ฐ๊ธฐ

๐Ÿ’ก ๋งˆ์น˜๋ฉฐ

์™€! ์ •๋ง ๊ธด ์—ฌ์ •์ด์—ˆ์ฃ ? ๐Ÿ˜… ํ•˜์ง€๋งŒ ์ด์ œ ์—ฌ๋Ÿฌ๋ถ„์€ JavaScript ๊ตญ์ œํ™”์˜ ๊ฑฐ์˜ ๋ชจ๋“  ๊ฒƒ์„ ์•Œ๊ฒŒ ๋˜์…จ์–ด์š”!

Intl ๊ฐ์ฒด๋Š” ์ •๋ง ๊ฐ•๋ ฅํ•œ ๋„๊ตฌ์˜ˆ์š”. ์˜ˆ์ „์—๋Š” ๋‹ค๊ตญ์–ด ์ง€์›์„ ์œ„ํ•ด ๋ณต์žกํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•˜๊ฑฐ๋‚˜ ์ง์ ‘ ๊ตฌํ˜„ํ•ด์•ผ ํ–ˆ์ง€๋งŒ, ์ด์ œ๋Š” ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ๊ธฐ๋ณธ์œผ๋กœ ์ œ๊ณตํ•˜๋Š” API๋งŒ์œผ๋กœ๋„ ์ถฉ๋ถ„ํžˆ ํ›Œ๋ฅญํ•œ ๋‹ค๊ตญ์–ด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ๋งŒ๋“ค ์ˆ˜ ์žˆ์–ด์š”. ๐Ÿš€

๐ŸŽฏ ํ•ต์‹ฌ ํฌ์ธํŠธ ์ •๋ฆฌ โœ… Intl.DateTimeFormat: ๋‚ ์งœ์™€ ์‹œ๊ฐ„์„ ํ˜„์ง€ํ™”
โœ… Intl.NumberFormat: ์ˆซ์ž, ํ†ตํ™”, ํผ์„ผํŠธ, ๋‹จ์œ„ ํ˜•์‹ํ™”
โœ… Intl.RelativeTimeFormat: "3์ผ ์ „" ๊ฐ™์€ ์ƒ๋Œ€ ์‹œ๊ฐ„ ํ‘œํ˜„
โœ… Intl.ListFormat: ๋ฐฐ์—ด์„ ์ž์—ฐ์Šค๋Ÿฌ์šด ๋ฌธ์žฅ์œผ๋กœ
โœ… Intl.DisplayNames: ์–ธ์–ด, ๊ตญ๊ฐ€, ํ†ตํ™” ์ด๋ฆ„ ํ‘œ์‹œ
โœ… Intl.Collator: ์–ธ์–ด๋ณ„ ์ •๋ ฌ ๊ทœ์น™ ์ ์šฉ
โœ… Intl.PluralRules: ๋ณต์ˆ˜ํ˜• ๊ทœ์น™ ์ฒ˜๋ฆฌ
โœ… ์„ฑ๋Šฅ ์ตœ์ ํ™”: ํฌ๋งทํ„ฐ ์žฌ์‚ฌ์šฉ๊ณผ ์บ์‹ฑ
โœ… ๋ธŒ๋ผ์šฐ์ € ํ˜ธํ™˜์„ฑ: ํด๋ฐฑ ์ฒ˜๋ฆฌ ํ•„์ˆ˜
๊ธ€๋กœ๋ฒŒ ์‹œ๋Œ€์— ๋‹ค๊ตญ์–ด ์ง€์›์€ ์„ ํƒ์ด ์•„๋‹Œ ํ•„์ˆ˜์˜ˆ์š”. ์—ฌ๋Ÿฌ๋ถ„์˜ ์„œ๋น„์Šค๊ฐ€ ์ „ ์„ธ๊ณ„ ์‚ฌ์šฉ์ž๋“ค์—๊ฒŒ ์‚ฌ๋ž‘๋ฐ›์„ ์ˆ˜ ์žˆ๋„๋ก, ์˜ค๋Š˜ ๋ฐฐ์šด ๋‚ด์šฉ์„ ๊ผญ ์‹ค์ „์— ์ ์šฉํ•ด๋ณด์„ธ์š”! ๐Ÿ’ช

ํ˜น์‹œ ๋” ๊ถ๊ธˆํ•œ ์ ์ด ์žˆ๊ฑฐ๋‚˜, ์‹ค๋ฌด์—์„œ ๋ง‰ํžˆ๋Š” ๋ถ€๋ถ„์ด ์žˆ๋‹ค๋ฉด ๊ฐœ๋ฐœ์ž ์ปค๋ฎค๋‹ˆํ‹ฐ๋‚˜ ์žฌ๋Šฅ๋„ท ๊ฐ™์€ ํ”Œ๋žซํผ์—์„œ ๋„์›€์„ ๊ตฌํ•˜๋Š” ๊ฒƒ๋„ ์ข‹์€ ๋ฐฉ๋ฒ•์ด์—์š”. ํ•จ๊ป˜ ์„ฑ์žฅํ•˜๋Š” ๊ฐœ๋ฐœ์ž๊ฐ€ ๋˜์–ด๋ด์š”! ๐ŸŒŸ

์—ฌ๋Ÿฌ๋ถ„์˜ ์ฝ”๋“œ๊ฐ€ ์ „ ์„ธ๊ณ„ ์–ด๋””์„œ๋‚˜ ์™„๋ฒฝํ•˜๊ฒŒ ์ž‘๋™ํ•˜๊ธธ ๋ฐ”๋ผ๋ฉฐ, ์ด๋งŒ ๊ธ€์„ ๋งˆ์น ๊ฒŒ์š”. ํ™”์ดํŒ…! ๐ŸŽ‰

๐ŸŒ Happy Internationalizing! ๐Ÿš€

์ „ ์„ธ๊ณ„๊ฐ€ ์—ฌ๋Ÿฌ๋ถ„์˜ ๋ฌด๋Œ€์ž…๋‹ˆ๋‹ค!

๋Œ“๊ธ€ ์ž‘์„ฑ

์ด ๊ธ€์— ๋Œ€ํ•œ ์—ฌ๋Ÿฌ๋ถ„์˜ ์ƒ๊ฐ์„ ๋“ค๋ ค์ฃผ์„ธ์š”

๋Œ“๊ธ€ 0
๋Œ“๊ธ€์„ ๋ถˆ๋Ÿฌ์˜ค๋Š” ์ค‘์ž…๋‹ˆ๋‹ค.

์•„์ง ๋Œ“๊ธ€์ด ์—†์Šต๋‹ˆ๋‹ค.