# General Translation React SDKs (gt-react, gt-next, gt-react-native): resolveCanonicalLocale
URL: https://generaltranslation.com/ja/docs/react/nextjs/reference/functions/resolve-canonical-locale.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: General Translation を使って、Next.js App Router のサーバーコードで設定されたロケールのエイリアスを解決します。resolveCanonicalLocale の API リファレンス。

`resolveCanonicalLocale` 関数は、ロケールまたは設定されたエイリアスを正規の BCP 47 ロケールコードに変換します。App Router のサーバーコードでは、`gt-next/server` からインポートします。

`resolveCanonicalLocale` はサーバー専用で、Pages Router では使用できません。

## 概要 [#overview]

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

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

## パラメータ [#parameters]

| パラメータ    | 説明                | 型        | 任意  | デフォルト |
| -------- | ----------------- | -------- | --- | ----- |
| `locale` | 解決するロケールコードまたはエイリアス。 | `string` | いいえ | —     |

## 戻り値 [#returns]

**Type** `string`

この値に対して設定されている正規ロケール。カスタムエイリアスは [`customMapping`](/docs/react/reference/config#custom-mapping) で設定されます。

## 例 [#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.
