# General Translation React SDKs (gt-react, gt-next): useLocale URL: https://generaltranslation.com/en-US/docs/react/reference/hooks/use-locale.mdx --- title: useLocale description: Read the active locale with General Translation gt-react. API reference for useLocale. --- The `useLocale` hook returns the user's current locale from the [``](/docs/react/reference/components/gt-provider) context, as a BCP 47 locale code such as `en-US`. *Available in `gt-react`, `gt-next`, `gt-tanstack-start`, and `gt-react-native`. Examples import from `gt-react`; import from your framework's package instead.* ## Overview [#overview] Call `useLocale` to read the active locale. ```tsx import { useLocale } from 'gt-react'; export default function CurrentLocale() { const locale = useLocale(); // [!code highlight] return

Current locale: {locale}

; } ``` *Note: In `gt-react`, call `useLocale` under a [``](/docs/react/reference/components/gt-provider). In `gt-next`, it also works in synchronous server components.* ## How it works [#how-it-works] When an unsupported locale is requested, a fallback is selected: - If the user has multiple preferred locales configured in their browser and one is supported, the best supported language is used. - Otherwise, if two locales share the same language (for example, `en-US` and `en-GB`), the supported locale sharing that language is used. - If neither applies, the [default locale](/docs/react/reference/config#default-locale) is used. ## Returns [#returns] **Type** `string` The user's current locale, such as `en-US`. ## Notes [#notes] - In an async App Router component, use [`getLocale`](/docs/react/nextjs/reference/functions/get-locale) instead. - To change the locale, use [`useSetLocale`](/docs/react/reference/hooks/use-set-locale); to read the source locale, use [`useDefaultLocale`](/docs/react/reference/hooks/use-default-locale).