diff --git a/src/app/admin/audit-logs/page.tsx b/src/app/admin/audit-logs/page.tsx index b8e32e0..c9af3e5 100644 --- a/src/app/admin/audit-logs/page.tsx +++ b/src/app/admin/audit-logs/page.tsx @@ -64,7 +64,7 @@ export default function AuditLogsPage() { }; if (authLoading || (role !== 'admin' && role !== null)) { - return
Verificando credenciales...
; + return
{t('audit.loading')}
; } if (role !== 'admin') { @@ -83,7 +83,7 @@ export default function AuditLogsPage() { {/* Audit Logs Table */}
{isLoading ? ( -
Cargando registros...
+
{t('audit.loading')}
) : logs.length === 0 ? (
{t('audit.empty')}
) : ( @@ -135,9 +135,9 @@ export default function AuditLogsPage() {
ID: {selectedLog.id}
-
Actor: {selectedLog.user.username} ({selectedLog.user.email})
-
Acción: {selectedLog.action}
-
Tabla: {selectedLog.targetTable} (ID: {selectedLog.targetId})
+
{t('audit.actor')}: {selectedLog.user.username} ({selectedLog.user.email})
+
{t('audit.action')}: {selectedLog.action}
+
{t('audit.target_table')}: {selectedLog.targetTable} (ID: {selectedLog.targetId})
Fecha: {new Date(selectedLog.createdAt).toLocaleString()}
IP: {selectedLog.ipAddress || '-'}
@@ -174,7 +174,7 @@ export default function AuditLogsPage() {
) : (
- Seleccione una fila para ver el JSON Diff + {t('audit.no_diff')}
)}
diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index d0011d2..13cad08 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -82,7 +82,7 @@ export default function DashboardPage() { }; if (authLoading || (!isRoleAuthorized && role !== null)) { - return
Verificando credenciales...
; + return
{t('dashboard.loading')}
; } if (!isRoleAuthorized) { @@ -104,7 +104,7 @@ export default function DashboardPage() { {isLoading ? ( -
Cargando panel de control...
+
{t('dashboard.loading')}
) : ( <> {/* KPI Cards Grid */} diff --git a/src/app/goals/page.tsx b/src/app/goals/page.tsx index 7bceb9f..fab4e90 100644 --- a/src/app/goals/page.tsx +++ b/src/app/goals/page.tsx @@ -113,11 +113,11 @@ export default function GoalsPage() { const data = await res.json(); if (!res.ok) { - setError(data.error || 'Error al asignar la meta.'); + setError(data.error || t('goals.errorSave')); return; } - setSuccess('Meta comercial asignada / actualizada exitosamente.'); + setSuccess(t('goals.successSave')); setAmount(''); // Reload goals list const goalsRes = await fetch('/api/goals'); @@ -126,7 +126,7 @@ export default function GoalsPage() { setGoals(goalsData.goals || []); } } catch (err) { - setError('Ocurrió un error al guardar la meta.'); + setError(t('goals.errorSave')); } }; @@ -147,34 +147,34 @@ export default function GoalsPage() {
-

Metas Comerciales

+

{t('goals.title')}

{/* Goal Assignment Form Section */} {(role === 'admin' || role === 'director') && (
-

Asignar Meta

+

{t('goals.assignTitle')}

{error &&
{error}
} {success &&
{success}
}
- +
{targetType === 'INDIVIDUAL' && (
- + setTargetId(e.target.value)} - placeholder="Ej. ID de Hotel o Equipo" + placeholder="Ej. ID de {t('targetType.HOTEL')} o {t('targetType.TEAM')}" required />
)}
- +
- +
@@ -243,15 +243,15 @@ export default function GoalsPage() {

Historial de Metas

{isLoading ? ( -
Cargando metas...
+
{t('goals.loading')}
) : (
- - + + diff --git a/src/app/history/page.tsx b/src/app/history/page.tsx index 218fc2b..66dca95 100644 --- a/src/app/history/page.tsx +++ b/src/app/history/page.tsx @@ -179,7 +179,7 @@ export default function HistoryPage() { onChange={(e) => setSelectedUserId(e.target.value)} id="filter-collaborator" > - + {users.map((u) => (
ObjetivoPeríodoTipo{t('goals.thPeriod')}{t('goals.thType')} Cuota ($)
- - - - + + + + {validationErrors.map((err, idx) => ( - + diff --git a/src/app/sales/simulation/page.tsx b/src/app/sales/simulation/page.tsx index b5ec957..c441048 100644 --- a/src/app/sales/simulation/page.tsx +++ b/src/app/sales/simulation/page.tsx @@ -142,13 +142,13 @@ export default function SimulationPage() { }); if (simulateOnly) { - setSuccess('Simulación completada con éxito. Los resultados no se han guardado.'); + setSuccess(t('simulation.successSimulate')); } else { - setSuccess('Liquidaciones calculadas y guardadas correctamente.'); + setSuccess(t('simulation.successCalculate')); } } catch (err: any) { console.error('Calculation fetch error:', err); - setError('Error al comunicarse con el servidor.'); + setError(t('simulation.serverError')); } finally { setIsProcessing(false); } @@ -159,7 +159,7 @@ export default function SimulationPage() {
-

Cargando panel de simulación...

+

{t('simulation.loading')}

); @@ -172,9 +172,9 @@ export default function SimulationPage() {
-

Acceso Restringido

+

{t('simulation.restrictedTitle')}

- Lo sentimos, esta sección es exclusiva para el Administrador y el Analista de Compensaciones. + {t('simulation.restrictedDesc')}

diff --git a/src/app/settlements/approvals/page.tsx b/src/app/settlements/approvals/page.tsx index 600bbd5..b379ff3 100644 --- a/src/app/settlements/approvals/page.tsx +++ b/src/app/settlements/approvals/page.tsx @@ -106,7 +106,7 @@ export default function ApprovalsPage() { fetchSettlements(); } catch (err) { console.error('Failed to approve settlement:', err); - setError('Error al comunicarse con el servidor.'); + setError(t('approvals.errorServer')); } }; @@ -141,16 +141,16 @@ export default function ApprovalsPage() { }); const data = await res.json(); if (!res.ok) { - setError(data.error || 'Error al rechazar la liquidación.'); + setError(data.error || t('approvals.errorReject')); setIsSubmittingReject(false); return; } - setSuccess('Liquidación rechazada.'); + setSuccess(t('approvals.successReject')); closeRejectModal(); fetchSettlements(); } catch (err) { console.error('Failed to reject settlement:', err); - setError('Error al comunicarse con el servidor.'); + setError(t('approvals.errorServer')); } finally { setIsSubmittingReject(false); } @@ -161,7 +161,7 @@ export default function ApprovalsPage() {
-

Cargando panel de aprobaciones...

+

{t('approvals.loading')}

); @@ -174,11 +174,11 @@ export default function ApprovalsPage() {
-

Panel de Aprobaciones

+

{t('approvals.title')}

{isLeader - ? 'Revise y apruebe las liquidaciones de comisión de los colaboradores de su región.' - : 'Visualice y audite el estado de aprobación de las liquidaciones de comisiones.'} + ? t('approvals.leaderDesc') + : t('approvals.globalDesc')}

@@ -205,7 +205,7 @@ export default function ApprovalsPage() { {settlements.length === 0 ? (
) : ( @@ -265,14 +265,14 @@ export default function ApprovalsPage() { className={styles.btnApprove} onClick={() => handleApprove(s.id)} > - Aprobar + {t('approvals.btnApprove')} ) : ( @@ -292,7 +292,7 @@ export default function ApprovalsPage() { {showRejectModal && (
-

Rechazar Liquidación

+

{t('approvals.btnReject')} Liquidación

FilaColumnaValor LeídoDetalle del Error{t('import.thRow')}{t('import.thColumn')}{t('import.thValue')}{t('import.thError')}
Fila {err.row}{t('import.thRow')} {err.row} {err.column} {String(err.value || '')} {translate(err.code, err.metadata, err.value)}
- No se encontraron liquidaciones pendientes en su región. + {t('approvals.empty')}