Refactor broadcast and user logs messages for localization support
- Updated the broadcast confirmation message to utilize localization for dynamic content, enhancing multilingual support. - Modified user logs display to incorporate localization for the title, improving consistency across languages. - Added new localization entries in both English and Russian for better user experience and clarity.
This commit is contained in:
@@ -337,15 +337,24 @@ async def confirm_broadcast_callback_handler(
|
||||
# Get queue stats for detailed report
|
||||
queue_stats = queue_manager.get_queue_stats()
|
||||
|
||||
result_message = f"""🚀 Рассылка поставлена в очередь!
|
||||
📤 В очередь добавлено: {sent_count}
|
||||
❌ Ошибок: {failed_count}
|
||||
|
||||
📊 Статус очередей:
|
||||
👥 Очередь пользователей: {queue_stats['user_queue_size']} сообщений
|
||||
📢 Очередь групп: {queue_stats['group_queue_size']} сообщений
|
||||
|
||||
ℹ️ Сообщения будут отправлены автоматически с соблюдением лимитов Telegram."""
|
||||
result_message = (
|
||||
_(
|
||||
"broadcast_queue_result",
|
||||
default=(
|
||||
"🚀 Рассылка поставлена в очередь!\n"
|
||||
"📤 В очередь добавлено: {sent_count}\n"
|
||||
"❌ Ошибок: {failed_count}\n\n"
|
||||
"📊 Статус очередей:\n"
|
||||
"👥 Очередь пользователей: {user_queue_size} сообщений\n"
|
||||
"📢 Очередь групп: {group_queue_size} сообщений\n\n"
|
||||
"ℹ️ Сообщения будут отправлены автоматически с соблюдением лимитов Telegram."
|
||||
),
|
||||
sent_count=sent_count,
|
||||
failed_count=failed_count,
|
||||
user_queue_size=queue_stats["user_queue_size"],
|
||||
group_queue_size=queue_stats["group_queue_size"],
|
||||
)
|
||||
)
|
||||
await callback.message.answer(
|
||||
result_message,
|
||||
reply_markup=get_back_to_admin_panel_keyboard(current_lang, i18n),
|
||||
|
||||
@@ -420,7 +420,9 @@ async def handle_view_user_logs(callback: types.CallbackQuery, user: User,
|
||||
), show_alert=True)
|
||||
return
|
||||
|
||||
logs_text_parts = [f"📜 <b>Последние действия пользователя {user.user_id}:</b>\n"]
|
||||
logs_text_parts = [
|
||||
f"{_('admin_user_recent_actions_title', default='📜 Последние действия пользователя {user_id}:', user_id=user.user_id)}\n"
|
||||
]
|
||||
|
||||
for log in logs:
|
||||
timestamp = log.timestamp.strftime('%Y-%m-%d %H:%M') if log.timestamp else 'N/A'
|
||||
|
||||
Reference in New Issue
Block a user