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.

useDateFormatter / DateFormatter

import { useDateFormatter } from '@vyui/core'

const formatter = useDateFormatter('en-US')
formatter.fullMonthAndYear(new Date()) // 'January 2026'

Date formatting that avoids the host Intl.DateTimeFormat when it isn't safe to use, returning helpers like custom, selectedDate, dayOfWeek, fullMonth, fullMonthAndYear, fullYear, dayPeriod, part, toParts, and getMonths.

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.