# General Translation Platform: getRegionProperties
URL: https://generaltranslation.com/en-US/docs/platform/core/reference/gt-class-methods/locales/get-region-properties.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Return region metadata for a locale or region code. API reference for getRegionProperties.

Retrieves details about a region code on a [GT](/docs/platform/core/reference/gt-class/constructor) instance, including its localized name and associated emoji flag. General Translation provides a convenient way to get region-specific display information for building internationalized user interfaces.

## Overview [#overview]

Call `getRegionProperties` on a [`GT`](/docs/platform/core/reference/gt-class/constructor) instance with an optional region code. When omitted, it uses the region from the instance's target locale.

```typescript
const gt = new GT({ sourceLocale: 'en-US', targetLocale: 'fr-FR' });

// Get region properties
const usProps = gt.getRegionProperties('US');
console.log(usProps);
// { code: 'US', name: 'États-Unis', emoji: '🇺🇸' }

const frProps = gt.getRegionProperties('FR');
console.log(frProps);
// { code: 'FR', name: 'France', emoji: '🇫🇷' }

// Auto-detect from current locale
const currentRegion = gt.getRegionProperties(); // Uses targetLocale's region
console.log(currentRegion);
// { code: 'FR', name: 'France', emoji: '🇫🇷' }
```

Signature:

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

*Note: `getRegionProperties` runs locally using `Intl.DisplayNames` and does not require an API key. It uses the region from the instance's `targetLocale` when `region` is omitted, and localizes the region name for the instance's `targetLocale`. For lookups without a `GT` instance, see the standalone [`getRegionProperties`](/docs/platform/core/reference/utility-functions/locales/get-region-properties).*

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

- **Region codes.** Accepts ISO 3166-1 alpha-2 or UN M.49 region codes (for example, `"US"`, `"FR"`, `"419"`).
- **Localized names.** Uses `Intl.DisplayNames` to localize the region name for the instance's `targetLocale`, falling back to the library default locale.
- **Custom mapping priority.** If a `customMapping` provides a `name` or `emoji` for the region, those override the defaults.
- **Fallbacks.** Falls back to the region code as `name` if display name resolution fails, and to a default emoji if no emoji mapping is found.
- **Region fallback.** When `region` is omitted, the region from the instance's target locale is used.
- **Missing locale.** Throws an `Error` if no target locale is available to determine region properties.

## Parameters [#parameters]

| Parameter | Description | Type | Optional | Default |
| --- | --- | --- | --- | --- |
| [`region`](#region) | ISO 3166-1 alpha-2 or UN M.49 region code. | `string` | Yes | `this.getLocaleProperties().regionCode` |
| [`customMapping`](#custom-mapping) | Custom region mapping to override default names and emojis. | `CustomRegionMapping` | Yes | `this.customRegionMapping` |

### `region` [#region]

**Type** `string` · **Optional** · **Default** `this.getLocaleProperties().regionCode`

ISO 3166-1 alpha-2 or UN M.49 region code. If not provided, uses the region from the instance's target locale.

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

**Type** `CustomRegionMapping` · **Optional** · **Default** `this.customRegionMapping`

Optional custom region mapping to override default region names and emojis.

## Returns [#returns]

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

An object containing:

- `code`: the input region code.
- `name`: the localized (or custom) region name in the target locale language.
- `emoji`: the associated emoji flag or symbol.

## Examples [#examples]

```typescript
// Basic region information
const gt = new GT({ sourceLocale: 'en-US', targetLocale: 'en-US' });

// Common region codes
console.log(gt.getRegionProperties('US')); // { code: 'US', name: 'United States', emoji: '🇺🇸' }
console.log(gt.getRegionProperties('GB')); // { code: 'GB', name: 'United Kingdom', emoji: '🇬🇧' }
console.log(gt.getRegionProperties('DE')); // { code: 'DE', name: 'Germany', emoji: '🇩🇪' }
console.log(gt.getRegionProperties('JP')); // { code: 'JP', name: 'Japan', emoji: '🇯🇵' }
```

```typescript
// Custom region mapping overrides the defaults
const gt = new GT({ targetLocale: 'en-US' });

console.log(gt.getRegionProperties('US', { US: { name: 'USA', emoji: '🗽' } }));
// { code: 'US', name: 'USA', emoji: '🗽' }
```

## Notes [#notes]

- Uses the `Intl.DisplayNames` API for localized region names.
- Supports both ISO 3166-1 alpha-2 and UN M.49 region codes.
- Custom mappings override default names and emojis.
- Automatically detects the region from the target locale if no parameter is provided.
- Falls back to the region code as the name if display name resolution fails.

## Sitemap

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