"""
Scripts which are somehow connected to locales
"""
from aiogram import Dispatcher

from core.configs.locales import I18N_DOMAIN, LOCALES_DIR
from core.utils.middlewares.aclmiddleware import ACLMiddleware

i18n = ACLMiddleware(I18N_DOMAIN, LOCALES_DIR)


def on_startup(dp: Dispatcher):
    """
    Inits localization for the dispatcher
    """
    dp.middleware.setup(i18n)


_ = i18n.lazy_gettext

LANGUAGE_MAPPING = {"ru": "🇷🇺 Русский", "en": "🇬🇧 English"}
