···369369370370The extension is included in our workspace recommendations, so VSCode should prompt you to install it.
371371372372-### Formatting with locale
372372+### Formatting numbers and dates
373373374374-When formatting numbers or dates that should respect the user's locale, pass the locale:
374374+Use vue-i18n's built-in formatters for locale-aware formatting:
375375376376-```typescript
377377-const { locale } = useI18n()
378378-const formatted = formatNumber(12345, locale.value) // "12,345" in en-US
376376+```vue
377377+<template>
378378+ <p>{{ $n(12345) }}</p>
379379+ <!-- "12,345" in en-US, "12 345" in fr-FR -->
380380+ <p>{{ $d(new Date()) }}</p>
381381+ <!-- locale-aware date -->
382382+</template>
379383```
380384381385## Testing
···11-/** @public */
22-export function formatNumber(num: number, _locale?: string): string {
33- // TODO: Support different locales (needs care to ensure hydration works correctly)
44- return new Intl.NumberFormat('en-US').format(num)
55-}
66-71/** @public */
82export function toIsoDateString(date: Date): string {
93 const year = date.getUTCFullYear()
+1
scripts/compare-translations.ts
···11+/* eslint-disable no-console */
12import process from 'node:process'
23import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs'
34import { join } from 'node:path'