# General Translation Platform: getLocaleProperties URL: https://generaltranslation.com/en-US/docs/platform/core/reference/gt-class-methods/locales/get-locale-properties.mdx --- title: getLocaleProperties description: Return 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 internationalized user interfaces. ## Overview [#overview] Call `getLocaleProperties` on a [`GT`](/docs/platform/core/reference/gt-class/constructor) instance with an optional locale code. When omitted, it uses the instance'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's `targetLocale` when `locale` is omitted, and respects the instance'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] - **Maximized and minimized forms.** The method derives both a maximized form (with likely script and region added) and a minimized form of the locale code. - **Display language.** All display names respect the instance'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'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, uses the instance's `targetLocale`. ## 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`: language name in the display language (for example, `"Austrian German"`). - `nativeName`: language name in the locale's native language (for example, `"Österreichisches Deutsch"`). - `languageCode`, `languageName`, `nativeLanguageName`: base language information. - `nameWithRegionCode`, `nativeNameWithRegionCode`: language name with region code (for example, `"German (AT)"`). - `regionCode`, `regionName`, `nativeRegionName`: region information. - `scriptCode`, `scriptName`, `nativeScriptName`: script information. - `maximizedCode`, `maximizedName`, `nativeMaximizedName`: maximized forms with likely script and region. - `minimizedCode`, `minimizedName`, `nativeMinimizedName`: minimized forms. - `emoji`: the flag or representative emoji for the locale'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 respect the instance's `sourceLocale` setting. - Custom mapping properties take precedence over standard `Intl` APIs.