Composables
i18n composables
Short reference for the internationalization composables Vy UI exports from @vyui/core. See the i18n page for the full story.
Internationalization is only partially built. This page covers what's exported today; see i18n for the complete story, including what's still planned.
From @vyui/core.
installIntlPolyfill
import { installIntlPolyfill } from '@vyui/core'
installIntlPolyfill()
Fills broken or missing Intl.DateTimeFormat / Intl.NumberFormat / Intl.Collator / Intl.Locale on native Lynx's PrimJS engine. English-only, idempotent, and a no-op on platforms with a working Intl (browsers, Lynx web). Call once at app entry, before any component constructs a formatter.
DateFormatter
import { DateFormatter } from '@vyui/core'
const formatter = new DateFormatter('en-US', { month: 'long', year: 'numeric' })
formatter.format(new Date()) // 'January 2026'
A drop-in Intl.DateTimeFormat that avoids the host formatter when it isn't safe to use. Same surface: format, formatToParts, formatRange, resolvedOptions.
useLocale
import { useLocale } from '@vyui/core'
const locale = useLocale() // ComputedRef<string>, defaults to 'en'
The active locale from the nearest ConfigProvider, or 'en' outside one.
useDirection
import { useDirection } from '@vyui/core'
const dir = useDirection() // ComputedRef<'ltr' | 'rtl'>, defaults to 'ltr'
The active dir from the nearest ConfigProvider, or 'ltr' outside one.