# generaltranslation: General Translation Core SDK: resolveAliasLocale URL: https://generaltranslation.com/en-US/docs/core/class/methods/locales/resolve-alias-locale.mdx --- title: resolveAliasLocale description: API reference for the GT resolveAliasLocale method --- ## Overview The `resolveAliasLocale` method resolves a canonical locale code back to its original alias locale code when custom mapping is configured. This is the inverse operation of `resolveCanonicalLocale`. --- ## Reference ### Parameters ### Parameters description | Parameter | Description | |-----------|-------------| | `locale` | The canonical locale code to resolve back to its alias | | `customMapping` | Optional custom mapping to use instead of the instance's mapping | ### Returns `string` - The alias locale code if a mapping exists, otherwise the original locale code ### Throws - `Error` - If no locale is provided and no target locale is configured --- ## Examples ```typescript const gt = new GT({ sourceLocale: 'en', customMapping: { 'cn': { code: 'zh', name: 'Mandarin' }, } }); // Resolve canonical locale back to alias const alias = gt.resolveAliasLocale('zh'); console.log(alias); // "cn" // Non-mapped locale returns the original const unchanged = gt.resolveAliasLocale('es'); console.log(unchanged); // "es" ``` --- ## Notes - Returns the original alias locale code when a custom mapping exists - Returns the input locale unchanged if no mapping is found ## Next steps - Resolve canonical locales with [`resolveCanonicalLocale`](/docs/core/class/methods/locales/resolve-canonical-locale) - Validate locales with [`isValidLocale`](/docs/core/class/methods/locales/is-valid-locale) - Get locale properties with [`getLocaleProperties`](/docs/core/class/methods/locales/get-locale-properties)