# General Translation Platform: getLocaleProperties
URL: https://generaltranslation.com/en-GB/docs/platform/core/reference/gt-class-methods/locales/get-locale-properties.mdx
Docs index: https://generaltranslation.com/llms.txt
Description: Returns detailed language, script, region, and direction properties for a locale. API reference for getLocaleProperties.

Retrieves comprehensive properties for a locale code on a [GT](/docs/platform/core/reference/gt-class/constructor) instance, including display names, language, script and region information, and an emoji flag. General Translation returns a complete [`LocaleProperties`](/docs/platform/core/reference/types/locale-properties) object with the data needed to build rich internationalised user interfaces.

## Overview [#overview]

Call `getLocaleProperties` on a [`GT`](/docs/platform/core/reference/gt-class/constructor) instance with an optional locale code. If omitted, it uses the instance&#39;s `targetLocale`.

```typescript
const gt = new GT({ sourceLocale: 'en', targetLocale: 'es' });

const props = gt.getLocaleProperties('fr-CA');
console.log(props.name); // "Canadian French"
console.log(props.nativeName); // "français canadien"
console.log(props.emoji); // "🇨🇦"
```

Signature:

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

*Note: `getLocaleProperties` runs locally and does not require an API key. It uses the instance&#39;s `targetLocale` when `locale` is omitted, and respects the instance&#39;s `sourceLocale` for display names. For lookups without a `GT` instance, see the standalone [`getLocaleProperties`](/docs/platform/core/reference/utility-functions/locales/get-locale-properties).*

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

* **Maximised and minimised forms.** The method derives both a maximised form (with likely script and region added) and a minimised form of the locale code.
* **Display language.** All display names respect the instance&#39;s `sourceLocale` setting.
* **Custom mapping priority.** Properties defined in a [`CustomMapping`](/docs/platform/core/reference/types/custom-mapping) take precedence over the standard `Intl` APIs.
* **Locale fallback.** When `locale` is omitted, the instance&#39;s `targetLocale` is used.
* **Missing locale.** Throws an `Error` if no locale is provided and the instance has no `targetLocale` configured.

## Parameters [#parameters]

| Parameter           | Description                               | Type     | Optional | Default             |
| ------------------- | ----------------------------------------- | -------- | -------- | ------------------- |
| [`locale`](#locale) | BCP-47 locale code to get properties for. | `string` | Yes      | `this.targetLocale` |

### `locale` [#locale]

**Type** `string` · **Optional** · **Default** `this.targetLocale`

BCP-47 locale code to get properties for (for example, `"de-AT"`). If not provided, the instance&#39;s `targetLocale` is used.

## Returns [#returns]

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

A comprehensive object describing the locale:

* `code`: the full locale code (for example, `"de-AT"`).
* `name`: the language name in the display language (for example, `"Austrian German"`).
* `nativeName`: the language name in the locale&#39;s native language (for example, `"Österreichisches Deutsch"`).
* `languageCode`, `languageName`, `nativeLanguageName`: base language information.
* `nameWithRegionCode`, `nativeNameWithRegionCode`: the language name with region code (for example, `"German (AT)"`).
* `regionCode`, `regionName`, `nativeRegionName`: region information.
* `scriptCode`, `scriptName`, `nativeScriptName`: script information.
* `maximizedCode`, `maximizedName`, `nativeMaximizedName`: maximised forms with likely script and region.
* `minimizedCode`, `minimizedName`, `nativeMinimizedName`: minimised forms.
* `emoji`: the flag or representative emoji for the locale&#39;s region.

Throws an `Error` if no locale is provided and the instance has no `targetLocale` configured.

## Examples [#examples]

```typescript
// Basic usage
const gt = new GT({ sourceLocale: 'en', targetLocale: 'fr' });

// Get properties for target locale
const props = gt.getLocaleProperties();
console.log(props.name); // "French"
console.log(props.nativeName); // "français"
console.log(props.languageCode); // "fr"
console.log(props.regionCode); // "FR"
console.log(props.emoji); // "🇫🇷"

// Get properties for other locales
const germanProps = gt.getLocaleProperties('de-AT');
console.log(germanProps.name); // "Austrian German"
console.log(germanProps.nativeName); // "Österreichisches Deutsch"
console.log(germanProps.regionName); // "Austria"
console.log(germanProps.nativeRegionName); // "Österreich"
```

## Notes [#notes]

* All display names honour the instance&#39;s `sourceLocale` setting.
* Custom mapping properties take precedence over standard `Intl` APIs.

## Sitemap

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