Referencei18n
useLocale
React hook that returns the active BCP 47 locale from the nearest I18nProvider
Import
useLocale returns the resolved BCP 47 tag from the nearest I18nProvider, or 'en' when none is mounted.
Use it when UI copy depends on the active locale outside the translator, for example formatting or caption language hooks.
Example
Switch the provider locale to see useLocale supply the BCP 47 tag used to format a date.
- Active locale
- en-US
- Formatted date
- January 15, 2026