""" _ ___ __ _| |_ __ ___ ___ _ __ _ __ / __|/ _` | | '_ ` _ \ / _ \ '__| '__| \__ \ (_| | | | | | | | __/ | | | |___/\__, |_|_| |_| |_|\___|_| |_| |_| 🔒 Licensed under the GNU GPLv3 🌐 https://www.gnu.org/licenses/gpl-3.0.htmla """ # meta banner: https://github.com/sqlmerr/hikka_mods/blob/main/assets/banners/translation_manager.png?raw=true # meta icon: https://github.com/sqlmerr/hikka_mods/blob/main/assets/icons/translation_manager.png?raw=true # meta developer: @sqlmerr_m import asyncio import logging from .. import loader, utils from hikkatl.tl.patched import Message log = logging.getLogger(__name__) @loader.tds class TranslationManager(loader.Module): """Module for managing external modules translations""" strings = { "name": "TranslationManager", "no_args": " No args!", "get_txt": "`{}` Translation in {} module of language {}:\n
{}
\n{}", "custom": "🔧 Translation is edited", "default": "🔧 Translation is default", "404": " Module not found!", "success": " Success", "only_external": " You can manage translations in only external mods. To update them use custom language." } strings_ru = { "no_args": " Вы не передали аргументы!", "get_txt": "`{}` Перевод модуля {} в языке {}:\n
{}
\n{}", "custom": "🔧 Перевод изменен", "default": "🔧 Перевод стандартный", "404": " Модуль не найден!", "success": " Успешно", "only_external": " Ты можешь управлять переводами только в сторонних модулях. Чтобы изменить их, используй кастомный язык.", "_cls_doc": "Модуль для управления переводами сторонних модулей" } async def client_ready(self): while not self.lookup("Loader").fully_loaded: await asyncio.sleep(0.5) mods = self.get("mods") if not mods: return for mod, tr in mods.items(): module = self.lookup(mod) if not module: continue if module.__origin__.startswith("