Locale
Represents Discord's locale.
Attributes
str
The default name of the locale.
str
The native name of the language.
str
The Discord side identifier value of the locale.
Class Attributes
str
= 'Undefined'
The default name of the locales.
Stores the predefined locales. This container is accessed when translating a Discord side identifier of a locale. The identifier value is used as a key to get it's wrapper side representation.
type
= str
The locales' values' type.
Every predefined locale is also stored as a class attribute:
Type attribute name | Name | Value | Native name |
---|---|---|---|
bulgarian | Bulgarian | bg | български |
chinese_cn | Chinese (China) | zh-CN | 中文 |
chinese_tw | Chinese (Taiwan) | zh-TW | 繁體中文 |
croatian | Croatian | hr | Hrvatski |
czech | Czech | cs | Čeština |
danish | Danish | da | Dansk |
dutch | Dutch | nl | Nederlands |
english_gb | English (Great Britain) | en-GB | English, UK |
english_us | English (United States) | en-US | English, US |
finnish | Finnish | fi | Suomi |
french | French | fr | Français |
german | German | de | Deutsch |
greek | Greek | el | Ελληνικά |
hindi | Hindi | hi | हिन्दी |
hungarian | Hungarian | hu | Magyar |
indonesian | Indonesian | id | Bahasa Indonesia |
italian | Italian | it | Italiano |
japanese | Japanese | jp | 日本語 |
korean | Korean | ko | 한국어 |
lithuanian | Lithuanian | lt | Lietuviškai |
norwegian | Norwegian | no | Norsk |
polish | Polish | pl | Polski |
portuguese | Portuguese, Brazilian | pt-BR | Português do Brasil |
romanian | Romanian, Romania | ro | Română |
russian | Russian | ru | Pусский |
spanish | Spanish | es-ES | Español |
spanish_la | Spanish (Latin America) | es-419 | Español, LATAM |
swedish | Swedish | sv-SE | Svenska |
thai | Thai | th | ไทย |
turkish | Turkish | tr | Türkçe |
ukrainian | Ukrainian | uk | Українська |
vietnamese | Vietnamese | vi | Tiếng Việt |
Methods
(value, name, native_name)
__init__Creates an Locale
and stores it at the class's .INSTANCES
class attribute as well.
Parameter | Type | Description |
---|---|---|
value |
| The Discord side identifier value of the locale. |
name |
| The default name of the locale. |
native_name |
| The native name of the locale. |
(value)
getReturns the value's representation. If the value is already preinstanced, returns that, else creates a new object.
Parameter | Type | Description |
---|---|---|
value |
| The value to get it's representation. |
Returns
obj_ : PreinstancedBase
(value)
_from_valueCreates a new locale with the given value.
Parameter | Type | Description |
---|---|---|
value |
| The locale's identifier value. |
Returns
self : Locale
The created instance.
()
__eq__Returns whether self's value equals to the other object's.
()
__ge__Returns whether self's value is greater or equal to the other object's.
()
__getattr__Drops a rich attribute error.
()
__gt__Returns whether self's value is greater than the other object's.
()
__hash__Returns the hash of the preinstanced object.
()
__le__Returns whether self's value is less or equal to the other object's.
()
__lt__Returns whether self's value is less than the other object's.
()
__ne__Returns whether self's not equals to the other object's.
()
__repr__Returns the representation of the preinstanced object.