# gt-node: General Translation Node.js SDK: getLocaleProperties
URL: https://generaltranslation.com/en-US/docs/node/reference/functions/get-locale-properties.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Read display metadata for a locale in General Translation gt-node. API reference for getLocaleProperties.

Returns metadata about a locale — its name, native name, language, region, and script information. Use it to build locale selectors or display locale metadata to users.

## Overview [#overview]

Call `getLocaleProperties` with a locale code, or with no argument to use the current locale. It returns a [`LocaleProperties`](/docs/platform/core/reference/types/locale-properties) object.

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

const props = getLocaleProperties('en-US');
console.log(props.name); // 'American English'
```

Signature:

```ts
getLocaleProperties(locale?: string): LocaleProperties
```

*Note: This function is synchronous — it does not need to be awaited.*

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

- **Locale fallback.** When `locale` is omitted, it describes the current locale.
- **Derived subtags.** It resolves language, script, and region subtags and their display names, plus maximized forms.
- **Synchronous.** It returns immediately and does not require a network request.

## Parameters [#parameters]

| Parameter | Description | Type | Optional | Default |
| --- | --- | --- | --- | --- |
| [`locale`](#locale) | A BCP 47 locale code to describe. | `string` | Yes | Current locale |

### `locale` [#locale]

**Type** `string` · **Optional** · **Default** Current locale

A BCP 47 locale code (for example, `'en-US'`, `'ja'`). When not provided, uses the current locale.

## Returns [#returns]

**Type** [`LocaleProperties`](/docs/platform/core/reference/types/locale-properties)

A [`LocaleProperties`](/docs/platform/core/reference/types/locale-properties) object with the following fields:

| Field | Type | Description |
| --- | --- | --- |
| `code` | `string` | The locale code (for example, `'en-US'`). |
| `name` | `string` | The English name of the locale (for example, `'American English'`). |
| `nativeName` | `string` | The name in the locale's own language (for example, `'American English'`). |
| `languageCode` | `string` | The language subtag (for example, `'en'`). |
| `languageName` | `string` | The English name of the language (for example, `'English'`). |
| `nativeLanguageName` | `string` | The language name in its own language (for example, `'English'`). |
| `nameWithRegionCode` | `string` | The locale name including region (for example, `'English (US)'`). |
| `nativeNameWithRegionCode` | `string` | The native locale name including region. |
| `regionCode` | `string` | The region subtag (for example, `'US'`). |
| `regionName` | `string` | The English name of the region (for example, `'United States'`). |
| `nativeRegionName` | `string` | The region name in the locale's own language. |
| `scriptCode` | `string` | The script subtag (for example, `'Latn'`). |
| `scriptName` | `string` | The English name of the script (for example, `'Latin'`). |
| `nativeScriptName` | `string` | The script name in the locale's own language. |
| `maximizedCode` | `string` | The fully expanded locale code (for example, `'en-Latn-US'`). |
| `maximizedName` | `string` | The English name of the maximized locale (for example, `'American English (Latin)'`). |
| `nativeMaximizedName` | `string` | The maximized locale name in its own language. |
| `minimizedCode` | `string` | The minimal locale code (for example, `'en'`). |
| `minimizedName` | `string` | The English name of the minimized locale. |
| `nativeMinimizedName` | `string` | The minimized locale name in its own language. |
| `emoji` | `string` | A flag or representative emoji for the locale. |

## Examples [#examples]

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

app.get('/api/locale-info', (req, res) => {
  const props = getLocaleProperties('ja');
  res.json({
    name: props.name,             // 'Japanese'
    nativeName: props.nativeName, // '日本語'
    script: props.scriptName,     // 'Japanese'
  });
});
```

## Notes [#notes]

- This function is synchronous — it does not need to be awaited.
- Useful for building locale selectors or displaying locale metadata to users.

## Sitemap

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