useLocale @astryx-svelte/core v0.4.5 · i18n

Usage

Reads the authoritative Astryx locale. Use it to thread the provider locale into pure formatting helpers and sibling-package APIs; do not derive a second locale from navigator.language or a hardcoded literal.
ts
import { i18n } from '@astryx-svelte/core';

Best practices

GuidancePractices
DoPass the returned locale to pure Astryx helpers or package APIs that require an explicit locale.
Don'tUse navigator.language or a hardcoded display locale as a fallback; InternationalizationProvider is the locale source.

Returns

FieldTypeDefaultDescription
locale LocaleThe active InternationalizationProvider BCP 47 locale. Falls back to 'en' when no provider is present.

Not declared by core, so this type is mapped from upstream's rather than read from the compiler.