Feature: Agregar soporte i18n a todas las páginas restantes

- recurrentes.php, sent_messages.php, gallery.php
- admin/users.php, recipients.php, languages.php, comandos.php
- admin/test_discord_connection.php, ia_agent.php
- profile.php, set_webhook.php, chat_telegram.php
- translate_message.php, admin_send_message.php
- telegram/admin/telegram_bot_interactions.php
- telegram/admin/telegram_welcome.php
This commit is contained in:
2026-02-20 15:36:14 -06:00
parent d0478d949b
commit c24544360c
16 changed files with 52 additions and 36 deletions

View File

@@ -1,10 +1,11 @@
<?php
require_once __DIR__ . '/includes/db.php';
require_once __DIR__ . '/includes/session_check.php';
require_once __DIR__ . '/includes/i18n.php';
checkSession();
require_once __DIR__ . '/includes/activity_logger.php';
$pageTitle = 'Plantillas de Mensajes';
$pageTitle = t('Plantillas de Mensajes');
$templates = [];
$galleryImages = [];
@@ -70,9 +71,9 @@ require_once __DIR__ . '/templates/header.php';
?>
<div class="d-flex justify-content-between align-items-center mb-4">
<h2><i class="bi bi-repeat"></i> Plantillas de Mensajes</h2>
<h2><i class="bi bi-collection"></i> <?= t('Plantillas de Mensajes') ?></h2>
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#templateModal">
<i class="bi bi-plus-circle"></i> Nueva Plantilla
<i class="bi bi-plus-circle"></i> <?= t('Nueva Plantilla') ?>
</button>
</div>
@@ -83,19 +84,19 @@ require_once __DIR__ . '/templates/header.php';
<div class="row">
<?php if (empty($templates)): ?>
<div class="col-12">
<p class="text-muted text-center py-4">No hay plantillas creadas</p>
<p class="text-muted text-center py-4"><?= t('No hay plantillas creadas') ?></p>
</div>
<?php else: ?>
<?php foreach ($templates as $template): ?>
<div class="col-md-6 mb-4">
<div class="card border-0 shadow-sm h-100">
<div class="card-header bg-white border-0 d-flex justify-content-between align-items-center">
<div class="card-header border-0 d-flex justify-content-between align-items-center">
<h5 class="mb-0"><?= htmlspecialchars($template['name']) ?></h5>
<div class="btn-group btn-group-sm">
<button class="btn btn-outline-primary" onclick="editTemplate(<?= htmlspecialchars(json_encode($template)) ?>)">
<i class="bi bi-pencil"></i>
</button>
<form method="POST" onsubmit="return confirm('¿Eliminar esta plantilla?');" class="d-inline">
<form method="POST" onsubmit="return confirm('<?= t('¿Eliminar esta plantilla?') ?>');" class="d-inline">
<input type="hidden" name="action" value="delete">
<input type="hidden" name="id" value="<?= $template['id'] ?>">
<button type="submit" class="btn btn-outline-danger">
@@ -106,13 +107,13 @@ require_once __DIR__ . '/templates/header.php';
</div>
<div class="card-body">
<p class="text-muted small mb-2">
<i class="bi bi-terminal"></i> Comando: <code>#<?= htmlspecialchars($template['telegram_command'] ?? 'sin comando') ?></code>
<i class="bi bi-terminal"></i> <?= t('Comando') ?>: <code>#<?= htmlspecialchars($template['telegram_command'] ?? t('sin comando')) ?></code>
</p>
<div class="bg-light p-2 rounded mb-2" style="max-height: 100px; overflow-y: auto; font-size: 0.85rem;">
<?= strip_tags(substr($template['message_content'], 0, 200)) ?><?= strlen($template['message_content']) > 200 ? '...' : '' ?>
</div>
<button class="btn btn-sm btn-outline-info" data-bs-toggle="modal" data-bs-target="#previewModal<?= $template['id'] ?>">
<i class="bi bi-eye"></i> Ver preview
<i class="bi bi-eye"></i> <?= t('Ver preview') ?>
</button>
</div>
</div>