Function: fetchLanguage()
Retrieves the language name for a specific target, using InternationalizationHandler.fetchLanguage. If InternationalizationHandler.fetchLanguage is not defined or this function returns a nullish value, then there will be a series of fallback attempts in the following descending order:
- Returns Guild.preferredLocale.
- Returns InternationalizationOptions.defaultName if no guild was provided.
- Returns
'en-US'
if nothing else was found.
Parameters
Parameter | Type | Description |
---|---|---|
target | Target | The target to fetch the language from. |
Returns
Promise
<string
>
The name of the language key.
Since
2.0.0
See
resolveLanguage