# General Translation Platform: getRegionProperties URL: https://generaltranslation.com/en-GB/docs/platform/core/reference/utility-functions/locales/get-region-properties.mdx --- title: getRegionProperties 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'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.