BotLocale now has default_locale

This commit is contained in:
Profitroll 2023-08-06 12:51:06 +02:00
parent bc5be37ff1
commit 00b1058014
Signed by: profitroll
GPG Key ID: FA35CAB49DACD3B2

View File

@ -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: