# gt-node: General Translation Node.js SDK: getLocales
URL: https://generaltranslation.com/en-US/docs/node/reference/functions/get-locales.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: List the supported locales configured in General Translation gt-node. API reference for getLocales.

Returns the array of supported BCP 47 locale codes you set in [`initializeGT`](/docs/node/reference/functions/initialize-gt).

## Overview [#overview]

Call `getLocales` with no arguments to get the array of supported BCP 47 locale codes.

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

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

Signature:

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

## How it works [#how-it-works]

- **Reads configuration.** It returns the `locales` array passed to [`initializeGT`](/docs/node/reference/functions/initialize-gt).
- **Synchronous.** It returns immediately and does not need to be awaited.

## Parameters [#parameters]

`getLocales` takes no parameters.

## Returns [#returns]

**Type** `string[]`

An array of BCP 47 locale codes representing the supported locales.

## Examples [#examples]

```ts title="handler.js"
// Basic usage
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.
