EXEPERTAI LAB

Research alpha

Time Machine
EXEPERTAI LAB
GALLERY / COLLECTION
← Browse Astryx gallery
i18n·hook·@astryxdesign/core

useLocale

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.

@astryxdesign/core/i18n

Signature

Call shape
useLocale(): Locale
Returns
NameType and behavior
localeLocale
The active InternationalizationProvider BCP 47 locale. Falls back to 'en' when no provider is present.

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.

  • Pass the returned locale to pure Astryx helpers or package APIs that require an explicit locale.
  • Use navigator.language or a hardcoded display locale as a fallback; InternationalizationProvider is the locale source.