[Core] Support already loaded packages in [p]load (#2116)

This commit is contained in:
El Laggron
2018-10-07 23:18:28 +02:00
committed by Toby Harradine
parent ee7e8aa782
commit 76bbcf2f8c
4 changed files with 124 additions and 97 deletions

View File

@@ -3,8 +3,6 @@ import re
from pathlib import Path
from typing import Callable, Union
from . import commands
__all__ = ["get_locale", "set_locale", "reload_locales", "cog_i18n", "Translator"]
_current_locale = "en_us"
@@ -219,6 +217,12 @@ class Translator(Callable[[str], str]):
self.translations.update({untranslated: translated})
# This import to be down here to avoid circular import issues.
# This will be cleaned up at a later date
# noinspection PyPep8
from . import commands
def cog_i18n(translator: Translator):
"""Get a class decorator to link the translator to this cog."""