# gt-node: General Translation Node.js SDK: getLocales
URL: https://generaltranslation.com/ja/docs/node/reference/functions/get-locales.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: General Translation gt-node で設定されているサポートされているロケールを一覧表示します。getLocales の API リファレンス。

[`initializeGT`](/docs/node/reference/functions/initialize-gt) で設定した、サポートされている BCP 47 ロケールコードの配列を返します。

## 概要 [#overview]

サポートされている BCP 47 ロケールコードの配列を取得するには、`getLocales` を引数なしで呼び出します。

```ts
import { getLocales } from 'gt-node';

const locales = getLocales(); // ['en-US', 'es', 'fr']
```

シグネチャ:

```ts
getLocales(): string[]
```

## 動作 [#how-it-works]

* **設定を読み込みます。** [`initializeGT`](/docs/node/reference/functions/initialize-gt) に渡された `locales` 配列を返します。
* **同期的です。** すぐに返されるため、await する必要はありません。

## パラメータ [#parameters]

`getLocales` にパラメータはありません。

## 戻り値 [#returns]

**Type** `string[]`

サポートされているロケールを表す、BCP 47 ロケールコードの配列。

## 例 [#examples]

```ts title="handler.js"
// 基本的な使い方
import { getLocales } from 'gt-node';

app.get('/api/locales', (req, res) => {
  res.json({ supportedLocales: getLocales() });
});
```

## Sitemap

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