16 lines
412 B
Python
16 lines
412 B
Python
import logging
|
|
from logging import Logger
|
|
from typing import override, Any
|
|
|
|
from libbot.i18n.classes import BotLocale as LibBotLocale
|
|
|
|
logger: Logger = logging.getLogger(__name__)
|
|
|
|
|
|
class BotLocale(LibBotLocale):
|
|
@override
|
|
def _(self, key: str, *args: str, locale: str | None = None) -> Any:
|
|
locale = None if locale is None else locale.split("-")[0]
|
|
|
|
super()._(key, *args, locale=locale)
|