Feature: Traducir todas las vistas - parte 1

- admin/recipients.php: tablas, modales, labels
- admin/comandos.php: títulos, tablas, descripciones
- admin/test_discord_connection.php: formularios, alertas
- admin/ia_agent.php: configuración, parámetros
- profile.php: información, formulario contraseña
- set_webhook.php: alertas, formularios
- chat_telegram.php: usuarios, historial
- translate_message.php: formulario de traducción
This commit is contained in:
2026-02-20 16:01:06 -06:00
parent 65de04209f
commit 2dd99c04dd
8 changed files with 172 additions and 172 deletions

View File

@@ -69,9 +69,9 @@ require_once __DIR__ . '/../templates/header.php';
?>
<div class="d-flex justify-content-between align-items-center mb-4">
<h2><i class="bi bi-person-check"></i> Gestión de Destinatarios</h2>
<h2><i class="bi bi-person-check"></i> <?= t('Gestión de Destinatarios') ?></h2>
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#addRecipientModal">
<i class="bi bi-plus-circle"></i> Nuevo Destinatario
<i class="bi bi-plus-circle"></i> <?= t('Nuevo Destinatario') ?>
</button>
</div>
@@ -94,19 +94,19 @@ require_once __DIR__ . '/../templates/header.php';
<div class="card-body">
<?php $discordRecipients = array_filter($recipients, fn($r) => $r['platform'] === 'discord'); ?>
<?php if (empty($discordRecipients)): ?>
<p class="text-muted">No hay destinatarios de Discord</p>
<p class="text-muted"><?= t('No hay destinatarios de Discord') ?></p>
<?php else: ?>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>ID</th>
<th><?= t('ID') ?></th>
<th>Platform ID</th>
<th>Nombre</th>
<th>Tipo</th>
<th>Idioma</th>
<th>Creado</th>
<th>Acciones</th>
<th><?= t('Nombre') ?></th>
<th><?= t('Tipo') ?></th>
<th><?= t('Idioma') ?></th>
<th><?= t('Creado') ?></th>
<th><?= t('Acciones') ?></th>
</tr>
</thead>
<tbody>
@@ -115,7 +115,7 @@ require_once __DIR__ . '/../templates/header.php';
<td><?= $recipient['id'] ?></td>
<td><code><?= $recipient['platform_id'] ?></code></td>
<td><?= htmlspecialchars($recipient['name']) ?></td>
<td><?= $recipient['type'] ?></td>
<td><?= t($recipient['type'] === 'channel' ? 'Canal' : 'Usuario') ?></td>
<td>
<form method="POST" class="d-inline">
<input type="hidden" name="action" value="update_language">
@@ -131,7 +131,7 @@ require_once __DIR__ . '/../templates/header.php';
</td>
<td><?= date('d/m/Y', strtotime($recipient['created_at'])) ?></td>
<td>
<form method="POST" onsubmit="return confirm('¿Eliminar?');" class="d-inline">
<form method="POST" onsubmit="return confirm('<?= t('¿Eliminar?') ?>');" class="d-inline">
<input type="hidden" name="action" value="delete">
<input type="hidden" name="recipient_id" value="<?= $recipient['id'] ?>">
<button type="submit" class="btn btn-outline-danger btn-sm">
@@ -154,19 +154,19 @@ require_once __DIR__ . '/../templates/header.php';
<div class="card-body">
<?php $telegramRecipients = array_filter($recipients, fn($r) => $r['platform'] === 'telegram'); ?>
<?php if (empty($telegramRecipients)): ?>
<p class="text-muted">No hay destinatarios de Telegram</p>
<p class="text-muted"><?= t('No hay destinatarios de Telegram') ?></p>
<?php else: ?>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>ID</th>
<th><?= t('ID') ?></th>
<th>Platform ID</th>
<th>Nombre</th>
<th>Tipo</th>
<th>Idioma</th>
<th>Creado</th>
<th>Acciones</th>
<th><?= t('Nombre') ?></th>
<th><?= t('Tipo') ?></th>
<th><?= t('Idioma') ?></th>
<th><?= t('Creado') ?></th>
<th><?= t('Acciones') ?></th>
</tr>
</thead>
<tbody>
@@ -175,7 +175,7 @@ require_once __DIR__ . '/../templates/header.php';
<td><?= $recipient['id'] ?></td>
<td><code><?= $recipient['platform_id'] ?></code></td>
<td><?= htmlspecialchars($recipient['name']) ?></td>
<td><?= $recipient['type'] ?></td>
<td><?= t($recipient['type'] === 'channel' ? 'Canal' : 'Usuario') ?></td>
<td>
<form method="POST" class="d-inline">
<input type="hidden" name="action" value="update_language">
@@ -191,7 +191,7 @@ require_once __DIR__ . '/../templates/header.php';
</td>
<td><?= date('d/m/Y', strtotime($recipient['created_at'])) ?></td>
<td>
<form method="POST" onsubmit="return confirm('¿Eliminar?');" class="d-inline">
<form method="POST" onsubmit="return confirm('<?= t('¿Eliminar?') ?>');" class="d-inline">
<input type="hidden" name="action" value="delete">
<input type="hidden" name="recipient_id" value="<?= $recipient['id'] ?>">
<button type="submit" class="btn btn-outline-danger btn-sm">
@@ -218,13 +218,13 @@ require_once __DIR__ . '/../templates/header.php';
<input type="hidden" name="action" value="add">
<div class="modal-header">
<h5 class="modal-title">Nuevo Destinatario</h5>
<h5 class="modal-title"><?= t('Nuevo Destinatario') ?></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<label class="form-label">Plataforma</label>
<label class="form-label"><?= t('Plataforma') ?></label>
<select name="platform" class="form-select" required>
<option value="discord">Discord</option>
<option value="telegram">Telegram</option>
@@ -232,26 +232,26 @@ require_once __DIR__ . '/../templates/header.php';
</div>
<div class="mb-3">
<label class="form-label">ID en la plataforma</label>
<input type="text" name="platform_id" class="form-control" required placeholder="Ej: 123456789">
<small class="text-muted">ID del canal/usuario en Discord o Telegram</small>
<label class="form-label"><?= t('ID en la plataforma') ?></label>
<input type="text" name="platform_id" class="form-control" required placeholder="<?= t('Ej') ?>: 123456789">
<small class="text-muted"><?= t('ID del canal/usuario en Discord o Telegram') ?></small>
</div>
<div class="mb-3">
<label class="form-label">Nombre</label>
<label class="form-label"><?= t('Nombre') ?></label>
<input type="text" name="name" class="form-control" required>
</div>
<div class="mb-3">
<label class="form-label">Tipo</label>
<label class="form-label"><?= t('Tipo') ?></label>
<select name="type" class="form-select" required>
<option value="channel">Canal</option>
<option value="user">Usuario</option>
<option value="channel"><?= t('Canal') ?></option>
<option value="user"><?= t('Usuario') ?></option>
</select>
</div>
<div class="mb-3">
<label class="form-label">Idioma</label>
<label class="form-label"><?= t('Idioma') ?></label>
<select name="language_code" class="form-select">
<?php foreach ($languages as $lang): ?>
<option value="<?= $lang['language_code'] ?>">
@@ -263,8 +263,8 @@ require_once __DIR__ . '/../templates/header.php';
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancelar</button>
<button type="submit" class="btn btn-primary">Agregar</button>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><?= t('Cancelar') ?></button>
<button type="submit" class="btn btn-primary"><?= t('Agregar') ?></button>
</div>
</form>
</div>