# General Translation Platform: getRegionProperties
URL: https://generaltranslation.com/en-GB/docs/platform/core/reference/utility-functions/locales/get-region-properties.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Returns region metadata without a GT instance. API reference for getRegionProperties.

[`getRegionProperties`](/docs/platform/core/reference/gt-class-methods/locales/get-region-properties) is a standalone utility function from General Translation&#39;s Core library that returns metadata about a region code, including its localised name and a representative emoji.

## Overview [#overview]

Import `getRegionProperties` directly from `generaltranslation` and call it with a region code and an optional display locale. It does not require an API key or a [GT](/docs/platform/core/reference/gt-class/constructor) instance. For the instance-based equivalent, use the [`getRegionProperties`](/docs/platform/core/reference/gt-class-methods/locales/get-region-properties) method on a [`GT`](/docs/platform/core/reference/gt-class/constructor) instance instead.

```typescript
import { getRegionProperties } from 'generaltranslation';

console.log(getRegionProperties('US', 'en-US'));
// { code: 'US', name: 'United States', emoji: '🇺🇸' }
```

Signature:

```typescript
getRegionProperties(
  region: string,
  defaultLocale?: string,
  customMapping?: CustomRegionMapping
): { code: string; name: string; emoji: string }
```

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

* **Localised names.** Uses the `Intl.DisplayNames` API to produce region names localised to `defaultLocale`.
* **Region codes.** Supports ISO 3166-1 alpha-2 and UN M.49 region codes.
* **Custom mapping.** A `CustomRegionMapping` can override default names and emojis.
* **Fallback.** Falls back to the region code if display name resolution fails.

## Parameters [#parameters]

| Parameter                          | Description                                         | Type                  | Optional | Default |
| ---------------------------------- | --------------------------------------------------- | --------------------- | -------- | ------- |
| [`region`](#region)                | Region code to get properties for.                  | `string`              | No       | —       |
| [`defaultLocale`](#default-locale) | Locale used to localise the region name.            | `string`              | Yes      | `en`    |
| [`customMapping`](#custom-mapping) | Custom mapping for region codes, names, and emojis. | `CustomRegionMapping` | Yes      | —       |

### `region` [#region]

**Type** `string` · **Required**

The region code for which to retrieve properties (ISO 3166-1 alpha-2 or UN M.49).

### `defaultLocale` [#default-locale]

**Type** `string` · **Optional** · **Default** `en`

The locale used to localise the returned region name.

### `customMapping` [#custom-mapping]

**Type** `CustomRegionMapping` · **Optional**

An optional custom mapping for region codes, which can override default names and emojis.

## Returns [#returns]

**Type** `{ code: string; name: string; emoji: string }`

An object containing region information, including the region code, localised name, and emoji.

## Examples [#examples]

```typescript
import { getRegionProperties } from 'generaltranslation';

// Region properties with English names
console.log(getRegionProperties('US', 'en-US'));
// { code: 'US', name: 'United States', emoji: '🇺🇸' }

console.log(getRegionProperties('JP', 'en-US'));
// { code: 'JP', name: 'Japan', emoji: '🇯🇵' }

// Region properties with localised names
console.log(getRegionProperties('US', 'de-DE'));
// { code: 'US', name: 'Vereinigte Staaten', emoji: '🇺🇸' }
```

## Notes [#notes]

* Uses the `Intl.DisplayNames` API for localised region names.
* Supports ISO 3166-1 alpha-2 and UN M.49 region codes.
* Custom mappings can override default names and emojis.
* Falls back to the region code if display name resolution fails.
* No external dependencies beyond browser APIs.

## Sitemap

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