[fix]: Fix argument

This commit is contained in:
Sweetbread
2023-05-15 23:22:19 +03:00
parent c0f11b96e6
commit d905aca2fe
3 changed files with 31 additions and 29 deletions
+2 -2
View File
@@ -15,8 +15,7 @@ class MeowTranslator(app_commands.Translator):
async def unload(self): pass
async def translate(self, string: app_commands.locale_str, locale: discord.Locale, context: app_commands.TranslationContext) -> Optional[str]:
logger.debug(f"{locale}\t{string.message}")
if str(locale) == "uk": locale = "ru"
if str(locale) == "ua": locale = "ru" # TODO: make translation for Ukranian
if str(locale) not in self.translations.keys(): return
if context.location is trans_context.other:
if f"{context.data}.{string.message}" in self.translations[str(locale)].keys():
@@ -27,6 +26,7 @@ class MeowTranslator(app_commands.Translator):
if string.message not in self.translations[str(locale)].keys(): return
return self.translations[str(locale)][string.message]
async def setup(bot):
await bot.tree.set_translator(MeowTranslator())