# General Translation React SDKs (gt-react, gt-next, gt-react-native): useLocale
URL: https://generaltranslation.com/en-US/docs/react/reference/hooks/use-locale.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Read the active locale. API reference for useLocale.

The `useLocale` hook returns the user's current locale from the [`<GTProvider>`](/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`.*

## Overview [#overview]

Call `useLocale` to read the active locale.

*Examples import from `gt-react`; import from your framework's package instead.*

```tsx
import { useLocale } from 'gt-react';

export default function CurrentLocale() {
  const locale = useLocale(); // [!code highlight]
  return <p>Current locale: {locale}</p>;
}
```

*Note: In `gt-react`, call `useLocale` under a [`<GTProvider>`](/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).

## Sitemap

See the full [sitemap](https://generaltranslation.com/sitemap.md) for all pages.
