# gt-next: General Translation Next.js SDK: getDefaultLocale URL: https://generaltranslation.com/ja/docs/next/api/helpers/get-default-locale.mdx --- title: getDefaultLocale description: getDefaultLocale のサーバーサイドメソッドに関する API リファレンス --- ## 概要 `getDefaultLocale` 関数は、アプリケーションのデフォルトロケールを取得します。 このロケールはサーバーの起動時に決定され、翻訳のフォールバック言語として使用されます。 戻り値は [ロケールコード](/docs/core/locales) (例: `'en'`) です。 `getDefaultLocale` はサーバーサイドのメソッドであり、サーバーサイド コンポーネントでのみ使用できます。 設定については [`withGTConfig`](/docs/next/api/config/with-gt-config) を参照してください。 [`withGTConfig`](/docs/next/api/config/with-gt-config) でデフォルトロケールが指定されていない場合、既定値は `'en'` です。 クライアントサイドについては [`useDefaultLocale`](/docs/next/api/helpers/use-default-locale) を参照してください。 ## リファレンス ### 戻り値 アプリケーションのデフォルト ロケールを表す文字列。例: `'en'`。 *** ## 例 ### 基本的な使い方 アプリケーションのデフォルトロケールを取得し、サーバーサイドのロジックで使用します。 ```jsx title="GetDefaultLocale.jsx" copy import { getDefaultLocale } from 'gt-next/server'; export default function GetDefaultLocale() { const defaultLocale = getDefaultLocale(); // [!code highlight] return

Default locale: {defaultLocale}

; } ``` *** ## 注意 * `getDefaultLocale` は、[`withGTConfig`](/docs/next/api/config/with-gt-config) で設定されたデフォルトのロケールを返します。 * `getDefaultLocale` はサーバーサイドでのみ利用できます。 * 返されるロケールは、[ロケールコード](/docs/core/locales) の形式に準拠しています。 ## 次のステップ * ユーザーのロケールを取得するには、[`useLocale`](/docs/next/api/helpers/use-locale) と [`getLocale`](/docs/next/api/helpers/get-locale) を参照してください。