Package net.dv8tion.jda.api.interactions
Enum DiscordLocale
- All Implemented Interfaces:
Serializable
,Comparable<DiscordLocale>
Enum representing the locales that Discord supports.
Based off Discord's locale list
-
Enum Constant Summary
Enum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic DiscordLocale
Converts the provided locale tag (such asen-GB
orfr
) to the enum constantstatic DiscordLocale
Converts the providedLocale
to the enum constantThe language's human-readable name, in English.The locale tag, could be parsed byLocale.forLanguageTag(String)
The language's human-readable name, translated to the current language.toLocale()
Creates aLocale
from this DiscordLocale.static DiscordLocale
Returns the enum constant of this type with the specified name.static DiscordLocale[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
BULGARIAN
-
CHINESE_CHINA
-
CHINESE_TAIWAN
-
CROATIAN
-
CZECH
-
DANISH
-
DUTCH
-
ENGLISH_UK
-
ENGLISH_US
-
FINNISH
-
FRENCH
-
GERMAN
-
GREEK
-
HINDI
-
HUNGARIAN
-
INDONESIAN
-
ITALIAN
-
JAPANESE
-
KOREAN
-
LITHUANIAN
-
NORWEGIAN
-
POLISH
-
PORTUGUESE_BRAZILIAN
-
ROMANIAN_ROMANIA
-
RUSSIAN
-
SPANISH
-
SPANISH_LATAM
-
SWEDISH
-
THAI
-
TURKISH
-
UKRAINIAN
-
VIETNAMESE
-
UNKNOWN
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getLocale
The locale tag, could be parsed byLocale.forLanguageTag(String)
- Returns:
- The locale tag
-
toLocale
Creates aLocale
from this DiscordLocale.
This is a simple shortcut toLocale.forLanguageTag(getLocale())
.Note: The returned
Locale
might not be the same locale as the one passed inDiscordLocale#from(Locale)
. SeeLocale.forLanguageTag(String)
for more details.- Returns:
- the
Locale
from this DiscordLocale - See Also:
-
getLanguageName
The language's human-readable name, in English.- Returns:
- The English language name
-
getNativeName
The language's human-readable name, translated to the current language.- Returns:
- The native language name
-
from
Converts the provided locale tag (such asen-GB
orfr
) to the enum constant- Parameters:
localeTag
- The locale tag- Returns:
- The DiscordLocale constant or
UNKNOWN
- Throws:
IllegalArgumentException
- If the locale tag is null
-
from
Converts the providedLocale
to the enum constant- Parameters:
locale
- The locale- Returns:
- The DiscordLocale constant or
UNKNOWN
- Throws:
IllegalArgumentException
- If the locale is null
-