From bc5be37ff18f486bf2d65fe6eab52787a501638b Mon Sep 17 00:00:00 2001 From: profitroll Date: Sun, 6 Aug 2023 12:50:34 +0200 Subject: [PATCH] locale is now Union[str, None] --- libbot/i18n/__init__.py | 4 ++-- libbot/i18n/sync/__init__.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libbot/i18n/__init__.py b/libbot/i18n/__init__.py index 79b23ef..d4488b2 100644 --- a/libbot/i18n/__init__.py +++ b/libbot/i18n/__init__.py @@ -10,7 +10,7 @@ from libbot.i18n.classes.bot_locale import BotLocale async def _( key: str, *args: str, - locale: str = "en", + locale: Union[str, None] = "en", locales_root: Union[str, Path] = Path("locale"), ) -> Any: """Get value of locale string @@ -18,7 +18,7 @@ async def _( ### Args: * key (`str`): The last key of the locale's keys path. * *args (`list`): Path to key like: `dict[args][key]`. - * locale (`str`): Locale to looked up in. Defaults to `"en"`. + * locale (`Union[str, None]`): Locale to looked up in. Defaults to `"en"`. * locales_root (`Union[str, Path]`, *optional*): Folder where locales are located. Defaults to `Path("locale")`. ### Returns: diff --git a/libbot/i18n/sync/__init__.py b/libbot/i18n/sync/__init__.py index 746a24a..995de03 100644 --- a/libbot/i18n/sync/__init__.py +++ b/libbot/i18n/sync/__init__.py @@ -8,7 +8,7 @@ import libbot def _( key: str, *args: str, - locale: str = "en", + locale: Union[str, None] = "en", locales_root: Union[str, Path] = Path("locale"), ) -> Any: """Get value of locale string @@ -16,7 +16,7 @@ def _( ### Args: * key (`str`): The last key of the locale's keys path. * *args (`list`): Path to key like: `dict[args][key]`. - * locale (`str`): Locale to looked up in. Defaults to `"en"`. + * locale (`Union[str, None]`): Locale to looked up in. Defaults to `"en"`. * locales_root (`Union[str, Path]`, *optional*): Folder where locales are located. Defaults to `Path("locale")`. ### Returns: