From 0c98251087ed70caaf2c867a2570eaae11fb601b Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 18 Aug 2025 06:19:30 -0400 Subject: [PATCH] Move Locale.language_code documentation to where it belongs --- discord/enums.py | 7 ------- docs/api.rst | 13 +++++++++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/discord/enums.py b/discord/enums.py index 6e6242145..0b66158cb 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -805,13 +805,6 @@ class Locale(Enum): @property def language_code(self) -> str: - """:class:`str`: Returns the locale's BCP 47 language code in the format of ``language-COUNTRY``. - - This is derived from a predefined mapping based on Discord's supported locales. - If no mapping exists for the current locale, this returns the raw locale value as a fallback. - - .. versionadded:: 2.6 - """ return _UNICODE_LANG_MAP.get(self.value, self.value) diff --git a/docs/api.rst b/docs/api.rst index 43ff502dd..7a75ba258 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -3604,6 +3604,15 @@ of :class:`enum.Enum`. The ``vi`` locale. + .. attribute:: language_code + + :class:`str`: Returns the locale's BCP 47 language code in the format of ``language-COUNTRY``. + + This is derived from a predefined mapping based on Discord's supported locales. + If no mapping exists for the current locale, this returns the raw locale value as a fallback. + + .. versionadded:: 2.6 + .. class:: MFALevel @@ -3998,7 +4007,7 @@ of :class:`enum.Enum`. .. class:: StatusDisplayType - Represents which field is of the user's activity is + Represents which field is of the user's activity is displayed in the members list. .. versionadded:: 2.6 @@ -4823,7 +4832,7 @@ AuditLogDiff See also :attr:`OnboardingPrompt.options` :type: List[:class:`OnboardingPromptOption`] - + .. attribute:: default_channels The default channels associated with the onboarding in this guild.