diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d48514336..dc00d10ce 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -6,6 +6,7 @@ core/config.py @tekulvw core/cog_manager.py @tekulvw core/data_manager.py @tekulvw core/drivers/* @tekulvw +core/i18n.py @tekulvw core/sentry_setup.py @Kowlin @tekulvw # Cogs diff --git a/core/bot.py b/core/bot.py index 8f295ac56..ea8bbb3d3 100644 --- a/core/bot.py +++ b/core/bot.py @@ -1,5 +1,4 @@ import asyncio -import importlib.util from importlib.machinery import ModuleSpec import discord @@ -14,6 +13,7 @@ from enum import Enum import os from core.cog_manager import CogManager +from core import i18n class Red(commands.Bot): @@ -29,7 +29,8 @@ class Red(commands.Bot): owner=None, whitelist=[], blacklist=[], - enable_sentry=None + enable_sentry=None, + locale='en' ) self.db.register_guild( @@ -73,11 +74,13 @@ class Red(commands.Bot): async def _dict_abuse(self, indict): """ Please blame <@269933075037814786> for this. + :param indict: :return: """ indict['owner_id'] = await self.db.owner() + i18n.set_locale(await self.db.locale()) async def is_owner(self, user): if user.id in self._co_owners: diff --git a/core/core_commands.py b/core/core_commands.py index 9679ee0cf..948c58d45 100644 --- a/core/core_commands.py +++ b/core/core_commands.py @@ -310,6 +310,9 @@ class Core: Changes bot locale. """ i18n.set_locale(locale_name) + + await ctx.bot.db.locale.set(locale_name) + await ctx.send(_("Locale has been set.")) @commands.command()