# General Translation React SDKs (gt-react, gt-next, gt-react-native): resolveCanonicalLocale
URL: https://generaltranslation.com/en-US/docs/react/nextjs/reference/functions/resolve-canonical-locale.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Resolve a configured locale alias in Next.js App Router server code with General Translation. API reference for resolveCanonicalLocale.

The `resolveCanonicalLocale` function converts a locale or configured alias into its canonical BCP 47 locale code. Import it from `gt-next/server` in App Router server code.

`resolveCanonicalLocale` is server-only and does not work with the Pages Router.

## Overview [#overview]

```tsx
import { resolveCanonicalLocale } from 'gt-next/server';

const locale = resolveCanonicalLocale('brand-french'); // 'fr-FR'
```

## Parameters [#parameters]

| Parameter | Description | Type | Optional | Default |
| --- | --- | --- | --- | --- |
| `locale` | Locale code or alias to resolve. | `string` | No | — |

## Returns [#returns]

**Type** `string`

The canonical locale configured for the value. Custom aliases come from [`customMapping`](/docs/react/reference/config#custom-mapping).

## Example [#example]

```tsx
import { resolveCanonicalLocale } from 'gt-next/server';

resolveCanonicalLocale('en-us'); // 'en-US'
```

## Sitemap

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