# node: getLocales URL: https://generaltranslation.com/ja/docs/node/api/get-locales.mdx --- title: getLocales description: getLocales関数のAPIリファレンス --- ## 概要 `getLocales` 関数は、[`initializeGT`](/docs/node/api/initialize-gt) で設定した、サポートされているロケールの一覧を返します。 ```js import { getLocales } from 'gt-node'; const locales = getLocales(); // ['en-US', 'es', 'fr'] ``` ## リファレンス ### パラメータ なし。 ### 戻り値 `string[]` — サポート対象のロケールを表す BCP 47 の[ロケールコード](/docs/core/locales)の配列です。 *** ## 例 ### 基本的な使い方 ```js title="handler.js" import { getLocales } from 'gt-node'; app.get('/api/locales', (req, res) => { res.json({ supportedLocales: getLocales() }); }); ``` *** ## 次のステップ * 現在のリクエストのロケールは、[`getLocale`](/docs/node/api/get-locale)を参照してください。 * デフォルトのロケールは、[`getDefaultLocale`](/docs/node/api/get-default-locale)を参照してください。