BotLocale now has default_locale
This commit is contained in:
parent
bc5be37ff1
commit
00b1058014
@ -10,6 +10,7 @@ class BotLocale:
|
|||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
default_locale: Union[str, None] = "en",
|
||||||
locales_root: Union[str, Path] = Path("locale"),
|
locales_root: Union[str, Path] = Path("locale"),
|
||||||
) -> None:
|
) -> None:
|
||||||
if isinstance(locales_root, str):
|
if isinstance(locales_root, str):
|
||||||
@ -23,7 +24,9 @@ class BotLocale:
|
|||||||
".".join(entry.split(".")[:-1]) for entry in files_locales
|
".".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 = {}
|
self.locales: dict = {}
|
||||||
|
|
||||||
for lc in valid_locales:
|
for lc in valid_locales:
|
||||||
|
Loading…
Reference in New Issue
Block a user