Skip to content

Commit 376311a

Browse files
committed
fix: translations
1 parent 6939c67 commit 376311a

3 files changed

Lines changed: 29 additions & 13 deletions

File tree

userbot/handlers/core_handlers.py

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -602,20 +602,29 @@ async def help_commands_handler(event: events.NewMessage.Event):
602602

603603
categories: Dict[str, List[str]] = {}
604604
core_commands: List[Tuple[str, str, str]] = [
605-
("Управление", ".listaccs", "help_listaccs"), ("Управление", ".addacc <name>", "help_addacc"),
606-
("Управление", ".delacc <name>", "help_delacc"), ("Управление", ".toggleacc <name>", "help_toggleacc"),
607-
("Управление", ".setlang <code|url>", "help_setlang"),
608-
("Модули", ".addmod <url>", "help_addmod"), ("Модули", ".delmod <name>", "help_delmod"),
609-
("Модули", ".trustmod <name>", "help_trustmod"),("Модули", ".configmod <...>", "help_configmod"),
610-
("Модули", ".updatemodule <name>", "help_updatemodule"), ("Модули", ".updatemodules", "help_updatemodules"),
611-
("Утилиты", ".ping", "help_ping"), ("Утилиты", ".restart", "help_restart"),
612-
("Утилиты", ".logs", "help_logs"),("Утилиты", ".about", "help_about"),
605+
("help_category_management", ".listaccs", "help_listaccs"),
606+
("help_category_management", ".addacc <name>", "help_addacc"),
607+
("help_category_management", ".delacc <name>", "help_delacc"),
608+
("help_category_management", ".toggleacc <name>", "help_toggleacc"),
609+
("help_category_management", ".setlang <code|url>", "help_setlang"),
610+
("help_category_modules", ".addmod <url>", "help_addmod"),
611+
("help_category_modules", ".delmod <name>", "help_delmod"),
612+
("help_category_modules", ".trustmod <name>", "help_trustmod"),
613+
("help_category_modules", ".configmod <...>", "help_configmod"),
614+
("help_category_modules", ".updatemodule <name>", "help_updatemodule"),
615+
("help_category_modules", ".updatemodules", "help_updatemodules"),
616+
("help_category_utilities", ".ping", "help_ping"),
617+
("help_category_utilities", ".restart", "help_restart"),
618+
("help_category_utilities", ".logs", "help_logs"),
619+
("help_category_utilities", ".about", "help_about"),
613620
]
614-
for category, pattern, key in core_commands:
615-
if category not in categories:
616-
categories[category] = []
617-
desc: str = await client.get_string(key)
618-
categories[category].append(f"`{pattern}` - {desc}")
621+
for category_key, pattern, desc_key in core_commands:
622+
translated_category: str = await client.get_string(category_key)
623+
if translated_category not in categories:
624+
categories[translated_category] = []
625+
desc: str = await client.get_string(desc_key)
626+
categories[translated_category].append(f"`{pattern}` - {desc}")
627+
619628
if account_id and account_id in GLOBAL_HELP_INFO:
620629
for mod_name, mod_info in GLOBAL_HELP_INFO[account_id].items():
621630
cat_name: str = mod_info.category.capitalize()
@@ -624,6 +633,7 @@ async def help_commands_handler(event: events.NewMessage.Event):
624633
for i, pattern in enumerate(mod_info.patterns):
625634
desc: str = mod_info.descriptions[i]
626635
categories[cat_name].append(f"`{pattern}` - {desc}")
636+
627637
final_text_parts: List[str] = [await client.get_string("help_header")]
628638
for i, (category, cmds) in enumerate(categories.items()):
629639
final_text_parts.append(f"\n╭ **{category}**")

userbot/locales/core/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
"logs_caption": "📄 **Logs Report**\n\n**Mode:** `{mode}`\n**Line Limit:** `{lines}`\n**Level:** `{level}`\n**Source:** `{source}`\n\n**Entries Found:** `{found}`",
4242
"help_header": "**DeBot | Command List**",
4343
"help_not_found": "❌ Command `{command}` not found.",
44+
"help_category_management": "Management",
45+
"help_category_modules": "Modules",
46+
"help_category_utilities": "Utilities",
4447
"help_listaccs": "List all accounts",
4548
"help_ext_listaccs": "**Command:** `.listaccs`\n\nShows a list of all accounts in the database, their ID, name, and status (enabled/disabled).",
4649
"help_addacc": "Add a new account",

userbot/locales/core/ru.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
"logs_caption": "📄 **Отчет по логам**\n\n**Режим:** `{mode}`\n**Лимит строк:** `{lines}`\n**Уровень:** `{level}`\n**Источник:** `{source}`\n\n**Найдено записей:** `{found}`",
4242
"help_header": "**DeBot | Список команд**",
4343
"help_not_found": "❌ Команда `{command}` не найдена.",
44+
"help_category_management": "Управление",
45+
"help_category_modules": "Модули",
46+
"help_category_utilities": "Утилиты",
4447
"help_listaccs": "Показать все аккаунты",
4548
"help_ext_listaccs": "**Команда:** `.listaccs`\n\nПоказывает список всех аккаунтов в базе данных, их ID, имя и статус (включен/отключен).",
4649
"help_addacc": "Добавить новый аккаунт",

0 commit comments

Comments
 (0)