# generaltranslation: General Translation Core SDK: getLocaleEmoji URL: https://generaltranslation.com/en-US/docs/core/functions/locales/get-locale-emoji.mdx --- title: getLocaleEmoji description: API reference for the standalone getLocaleEmoji function --- ## Overview The standalone `getLocaleEmoji` function retrieves an emoji flag or symbol for a locale code without requiring a GT class instance. It returns appropriate flag emojis for countries and territories based on the locale's region, with support for custom emoji mappings. ```typescript import { getLocaleEmoji } from 'generaltranslation'; const emoji = getLocaleEmoji('fr-CA'); console.log(emoji); // "πŸ‡¨πŸ‡¦" (Canadian flag) const usEmoji = getLocaleEmoji('en-US'); console.log(usEmoji); // "πŸ‡ΊπŸ‡Έ" (US flag) ``` --- ## Reference ### Parameters ### Parameters description | Parameter | Description | |-----------|-------------| | `locale` | BCP-47 locale code to get emoji for | | `customMapping` | Optional custom mapping for locale codes and emoji overrides | ### Returns `string` - Emoji flag or symbol representing the locale: - Country/territory flag emoji for locales with regions (e.g., `πŸ‡ΊπŸ‡Έ`, `πŸ‡«πŸ‡·`, `πŸ‡―πŸ‡΅`) - Custom emoji if defined in mapping - Default flag emoji (`🏳️`) for unrecognized locales --- ## Examples ### Basic emoji retrieval ```typescript import { getLocaleEmoji } from 'generaltranslation'; // Common country flags console.log(getLocaleEmoji('en-US')); // "πŸ‡ΊπŸ‡Έ" console.log(getLocaleEmoji('fr-FR')); // "πŸ‡«πŸ‡·" console.log(getLocaleEmoji('de-DE')); // "πŸ‡©πŸ‡ͺ" console.log(getLocaleEmoji('ja-JP')); // "πŸ‡―πŸ‡΅" console.log(getLocaleEmoji('zh-CN')); // "πŸ‡¨πŸ‡³" // Regions with multiple languages console.log(getLocaleEmoji('en-CA')); // "πŸ‡¨πŸ‡¦" console.log(getLocaleEmoji('fr-CA')); // "πŸ‡¨πŸ‡¦" console.log(getLocaleEmoji('de-CH')); // "πŸ‡¨πŸ‡­" console.log(getLocaleEmoji('fr-CH')); // "πŸ‡¨πŸ‡­" ``` --- ## Notes - Returns flag emojis using Unicode Regional Indicator Symbols - Custom mapping emojis take priority over region-based selection - Supports all ISO 3166-1 alpha-2 region codes for comprehensive coverage ## Next steps - Use GT class method [`getLocaleEmoji`](/docs/core/class/methods/locales/get-locale-emoji) - Get locale properties with [`getLocaleProperties`](/docs/core/functions/locales/get-locale-properties) - Get locale names with [`getLocaleName`](/docs/core/functions/locales/get-locale-name) - Validate locales with [`isValidLocale`](/docs/core/functions/locales/is-valid-locale)