mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-16 18:59:09 +00:00
Add Locale enum
This commit is contained in:
parent
6979e56088
commit
cc21872072
@ -57,6 +57,7 @@ __all__ = (
|
||||
'InteractionResponseType',
|
||||
'NSFWLevel',
|
||||
'MFALevel',
|
||||
'Locale',
|
||||
)
|
||||
|
||||
|
||||
@ -615,6 +616,42 @@ class MFALevel(Enum, comparable=True):
|
||||
require_2fa = 1
|
||||
|
||||
|
||||
class Locale(Enum):
|
||||
american_english = 'en-US'
|
||||
british_english = 'en-GB'
|
||||
bulgarian = 'bg'
|
||||
chinese = 'zh-CN'
|
||||
taiwan_chinese = 'zh-TW'
|
||||
croatian = 'hr'
|
||||
czech = 'cs'
|
||||
danish = 'da'
|
||||
dutch = 'nl'
|
||||
finnish = 'fi'
|
||||
french = 'fr'
|
||||
german = 'de'
|
||||
greek = 'el'
|
||||
hindi = 'hi'
|
||||
hungarian = 'hu'
|
||||
italian = 'it'
|
||||
japanese = 'ja'
|
||||
korean = 'ko'
|
||||
lithuanian = 'lt'
|
||||
norwegian = 'no'
|
||||
polish = 'pl'
|
||||
brazil_portuguese = 'pt-BR'
|
||||
Romanian = 'ro'
|
||||
Russian = 'ru'
|
||||
spain_spanish = 'es-ES'
|
||||
swedish = 'sv-SE'
|
||||
thai = 'th'
|
||||
turkish = 'tr'
|
||||
ukrainian = 'uk'
|
||||
vietnamese = 'vi'
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.value
|
||||
|
||||
|
||||
E = TypeVar('E', bound='Enum')
|
||||
|
||||
|
||||
|
127
docs/api.rst
127
docs/api.rst
@ -2648,6 +2648,133 @@ of :class:`enum.Enum`.
|
||||
|
||||
The guild may contain NSFW content.
|
||||
|
||||
.. class:: Locale
|
||||
|
||||
Supported locales by Discord. Mainly used for application command localisation.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
|
||||
.. attribute:: american_english
|
||||
|
||||
The ``en-US`` locale.
|
||||
|
||||
.. attribute:: british_english
|
||||
|
||||
The ``en-GB`` locale.
|
||||
|
||||
.. attribute:: bulgarian
|
||||
|
||||
The ``bg`` locale.
|
||||
|
||||
.. attribute:: chinese
|
||||
|
||||
The ``zh-CN`` locale.
|
||||
|
||||
.. attribute:: taiwan_chinese
|
||||
|
||||
The ``zh-TW`` locale.
|
||||
|
||||
.. attribute:: croatian
|
||||
|
||||
The ``hr`` locale.
|
||||
|
||||
.. attribute:: czech
|
||||
|
||||
The ``cs`` locale.
|
||||
|
||||
.. attribute:: danish
|
||||
|
||||
The ``da`` locale.
|
||||
|
||||
.. attribute:: dutch
|
||||
|
||||
The ``nl`` locale.
|
||||
|
||||
.. attribute:: finnish
|
||||
|
||||
The ``fi`` locale.
|
||||
|
||||
.. attribute:: french
|
||||
|
||||
The ``fr`` locale.
|
||||
|
||||
.. attribute:: german
|
||||
|
||||
The ``de`` locale.
|
||||
|
||||
.. attribute:: greek
|
||||
|
||||
The ``el`` locale.
|
||||
|
||||
.. attribute:: hindi
|
||||
|
||||
The ``hi`` locale.
|
||||
|
||||
.. attribute:: hungarian
|
||||
|
||||
The ``hu`` locale.
|
||||
|
||||
.. attribute:: italian
|
||||
|
||||
The ``it`` locale.
|
||||
|
||||
.. attribute:: japanese
|
||||
|
||||
The ``ja`` locale.
|
||||
|
||||
.. attribute:: korean
|
||||
|
||||
The ``ko`` locale.
|
||||
|
||||
.. attribute:: lithuanian
|
||||
|
||||
The ``lt`` locale.
|
||||
|
||||
.. attribute:: norwegian
|
||||
|
||||
The ``no`` locale.
|
||||
|
||||
.. attribute:: polish
|
||||
|
||||
The ``pl`` locale.
|
||||
|
||||
.. attribute:: brazil_portuguese
|
||||
|
||||
The ``pt-BR`` locale.
|
||||
|
||||
.. attribute:: Romanian
|
||||
|
||||
The ``ro`` locale.
|
||||
|
||||
.. attribute:: Russian
|
||||
|
||||
The ``ru`` locale.
|
||||
|
||||
.. attribute:: spain_spanish
|
||||
|
||||
The ``es-ES`` locale.
|
||||
|
||||
.. attribute:: swedish
|
||||
|
||||
The ``sv-SE`` locale.
|
||||
|
||||
.. attribute:: thai
|
||||
|
||||
The ``th`` locale.
|
||||
|
||||
.. attribute:: turkish
|
||||
|
||||
The ``tr`` locale.
|
||||
|
||||
.. attribute:: ukrainian
|
||||
|
||||
The ``uk`` locale.
|
||||
|
||||
.. attribute:: vietnamese
|
||||
|
||||
The ``vi`` locale.
|
||||
|
||||
|
||||
.. class:: MFALevel
|
||||
|
||||
Represents the Multi-Factor Authentication requirement level of a guild.
|
||||
|
Loading…
x
Reference in New Issue
Block a user