# gt-node: General Translation Node.js SDK: getDefaultLocale
URL: https://generaltranslation.com/en-US/docs/node/reference/functions/get-default-locale.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Read the configured source locale in General Translation gt-node. API reference for getDefaultLocale.

Returns the default locale configured in [`initializeGT`](/docs/node/reference/functions/initialize-gt). This is your source and fallback locale.

## Overview [#overview]

Call `getDefaultLocale` with no arguments to get the configured default BCP 47 locale code.

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

const defaultLocale = getDefaultLocale(); // 'en-US'
```

Signature:

```ts
getDefaultLocale(): string
```

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

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

## Parameters [#parameters]

`getDefaultLocale` takes no parameters.

## Returns [#returns]

**Type** `string`

The default BCP 47 locale code (for example, `'en-US'`).

## Examples [#examples]

```ts title="handler.js"
// Basic usage
import { getDefaultLocale } from 'gt-node';

app.get('/api/info', (req, res) => {
  res.json({ defaultLocale: getDefaultLocale() });
});
```

## Sitemap

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