Utility FunctionsLocales
getRegionProperties
API Reference for the getRegionProperties function
Overview
The getRegionProperties function retrieves detailed information about a region code without requiring a GT class instance.
Reference
Parameters
Prop
Type
Returns
{ code: string; name: string; emoji: string } - Region information object
Examples
import { getRegionProperties } from 'generaltranslation';
// Get 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: 'π―π΅' }
// Get region properties with localized names
console.log(getRegionProperties('US', 'de-DE'));
// { code: 'US', name: 'Vereinigte Staaten', emoji: 'πΊπΈ' }Notes
- Uses Intl.DisplayNamesAPI for localized 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 region code if display name resolution fails
- No external dependencies beyond browser APIs
Next Steps
- Use GT class method getRegionProperties
- Get full locale info with getLocaleProperties
How is this guide?

