From 00b10580143d94f27ba9eec2d10f75630670db59 Mon Sep 17 00:00:00 2001 From: profitroll Date: Sun, 6 Aug 2023 12:51:06 +0200 Subject: [PATCH] BotLocale now has default_locale --- libbot/i18n/classes/bot_locale.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libbot/i18n/classes/bot_locale.py b/libbot/i18n/classes/bot_locale.py index e4c5660..0ce73e9 100644 --- a/libbot/i18n/classes/bot_locale.py +++ b/libbot/i18n/classes/bot_locale.py @@ -10,6 +10,7 @@ class BotLocale: def __init__( self, + default_locale: Union[str, None] = "en", locales_root: Union[str, Path] = Path("locale"), ) -> None: if isinstance(locales_root, str): @@ -23,7 +24,9 @@ class BotLocale: ".".join(entry.split(".")[:-1]) for entry in files_locales ] - self.default: str = sync.config_get("locale") + self.default: str = ( + sync.config_get("locale") if default_locale is None else default_locale + ) self.locales: dict = {} for lc in valid_locales: