diff --git a/frontend/messages/en.json b/frontend/messages/en.json index f89b3438..b440a47e 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -1,6 +1,106 @@ { "$schema": "https://inlang.com/schema/inlang-message-format", "hello_world": "Hello, {name} from en!", + "dashboard": { + "greeting_morning": "Good morning", + "greeting_afternoon": "Good afternoon", + "greeting_evening": "Good evening", + "team_suffix": ", team.", + "operational_summary": "Operational Summary — Annexes 22/24/30", + "management_system": "Foreign Trade Management System", + "loading": "Loading...", + "update": "Update", + "operations_distribution": "Operations Distribution", + "top_clients": "Top 5 Clients", + "top_providers": "Top 5 Providers", + "by_invoice_number": "By number of invoices", + "quick_access": "Quick Access", + "most_used_modules": "Most Used Modules", + "invoices": "Invoices", + "manage_invoices": "Manage invoices", + "clients_and_providers": "Clients and Providers", + "manage_contacts": "Manage contacts", + "goods": "Goods", + "product_catalog": "Product catalog", + "reference_data": "Reference Data", + "sat_catalogs": "SAT Catalogs", + "total_documents": "Total Documents", + "total_contacts": "Total Contacts", + "active_items_stat": "Active Items", + "no_active_company": "No active company selected", + "load_error": "Error loading dashboard", + "pedimentos": "Pedimentos", + "clients": "Clients", + "providers": "Providers", + "pending_approvals": "Pending", + "operations_trend": "Operations Trend", + "monthly_evolution": "Monthly evolution of operations", + "recent_activity": "Recent Activity", + "latest_operations": "Latest operations registered in the system", + "no_recent_activity": "No recent activity", + "records_suffix": "records", + "just_now": "Just now", + "ago_suffix": "Ago", + "min_short": "min", + "h_short": "h", + "d_short": "d", + "no_data_available": "No data available", + "data_will_appear_here": "Data will appear here once registered", + "operations_in": "operations in", + "more_than_one_month_needed": "The graph will appear with more than one month of data", + "average_per_month": "Average / month", + "maximum": "Maximum", + "total": "Total", + "operations": "operations", + "previous_month": "prev. month", + "operations_breakdown": "Operations Breakdown", + "ops_short": "ops", + "operations_will_appear_here": "Operations will appear here once registered", + "no_data_available_short": "No data available" + }, + "exchange_rate": { + "new_title": "New Exchange Rate", + "edit_title": "Edit Exchange Rate", + "required_title": "Exchange Rate Required", + "required_description": "To proceed with saving, it is necessary to register the official exchange rate for this date.", + "applicable_date": "Applicable Date", + "exchange_rate_label": "Exchange Rate (MXN/USD)", + "required_badge": "Required", + "consulting": "Consulting...", + "consult_dof": "Consult DOF", + "example_suffix": "Eg.", + "cancel": "Cancel", + "ok": "Ok", + "confirm_title": "Are you sure?", + "confirm_description_create": "The exchange rate with value {value} will be created for the day {date}.", + "confirm_description_update": "The exchange rate with value {value} will be updated for the day {date}.", + "confirm_action": "Confirm", + "toast_dof_success": "Exchange rate obtained from DOF: {value}", + "toast_dof_error": "Could not obtain data from DOF", + "toast_dof_service_error": "Error consulting DOF service", + "error_no_company": "No company selected", + "error_date_required": "Date is required", + "error_value_required": "Exchange rate is required", + "error_value_positive": "Exchange rate must be a value greater than 0", + "toast_create_success": "Exchange rate created successfully", + "toast_update_success": "Exchange rate updated successfully" + }, + "multi_currency": { + "new_title": "New Multi-Currency Exchange Rate", + "edit_title": "Edit Multi-Currency Exchange Rate", + "error_currency_required": "Currency code is required", + "error_date_required": "Publication date is required", + "currency_label": "Currency", + "currency_help": "Currency code (FK).", + "country_label": "Country", + "country_help": "Country M3 key (FK).", + "date_label": "Date", + "date_help": "Saved as integer (YYYYMMDD).", + "factor_label": "Factor", + "saving": "Saving...", + "update": "Update", + "create": "Create" + }, "sidebar": { "dashboard": "Dashboard", "reference_data": { diff --git a/frontend/messages/es.json b/frontend/messages/es.json index 20fdeb57..615b18d2 100644 --- a/frontend/messages/es.json +++ b/frontend/messages/es.json @@ -1,6 +1,106 @@ { "$schema": "https://inlang.com/schema/inlang-message-format", "hello_world": "Hello, {name} from es!", + "dashboard": { + "greeting_morning": "Buenos días", + "greeting_afternoon": "Buenas tardes", + "greeting_evening": "Buenas noches", + "team_suffix": ", equipo.", + "operational_summary": "Resumen operativo — Anexos 22/24/30", + "management_system": "Sistema de gestión de comercio exterior", + "loading": "Cargando...", + "update": "Actualizar", + "operations_distribution": "Distribución de Operaciones", + "top_clients": "Top 5 Clientes", + "top_providers": "Top 5 Proveedores", + "by_invoice_number": "Por número de facturas", + "quick_access": "Accesos Rápidos", + "most_used_modules": "Módulos más utilizados", + "invoices": "Facturas", + "manage_invoices": "Gestionar facturas", + "clients_and_providers": "Clientes y Proveedores", + "manage_contacts": "Administrar contactos", + "goods": "Mercancías", + "product_catalog": "Catálogo de productos", + "reference_data": "Datos de Referencia", + "sat_catalogs": "Catálogos del SAT", + "total_documents": "Total Documentos", + "total_contacts": "Total Contactos", + "active_items_stat": "Items Activos", + "no_active_company": "No hay compañía activa seleccionada", + "load_error": "Error al cargar el dashboard", + "pedimentos": "Pedimentos", + "clients": "Clientes", + "providers": "Proveedores", + "pending_approvals": "Pendientes", + "operations_trend": "Tendencia de Operaciones", + "monthly_evolution": "Evolución mensual de operaciones", + "recent_activity": "Actividad Reciente", + "latest_operations": "Últimas operaciones registradas en el sistema", + "no_recent_activity": "No hay actividad reciente", + "records_suffix": "registros", + "just_now": "Ahora mismo", + "ago_suffix": "Hace", + "min_short": "min", + "h_short": "h", + "d_short": "d", + "no_data_available": "Sin datos disponibles", + "data_will_appear_here": "Los datos aparecerán aquí una vez registrados", + "operations_in": "operaciones en", + "more_than_one_month_needed": "La gráfica aparecerá con más de un mes de datos", + "average_per_month": "Promedio / mes", + "maximum": "Máximo", + "total": "Total", + "operations": "operaciones", + "previous_month": "mes ant.", + "operations_breakdown": "Desglose por tipo de operación", + "ops_short": "ops", + "operations_will_appear_here": "Las operaciones aparecerán aquí una vez registradas", + "no_data_available_short": "No hay datos disponibles" + }, + "exchange_rate": { + "new_title": "Nuevo Tipo de Cambio", + "edit_title": "Editar Tipo de Cambio", + "required_title": "Tipo de Cambio Requerido", + "required_description": "Para continuar con el guardado, es necesario registrar el tipo de cambio oficial para esta fecha.", + "applicable_date": "Fecha Aplicable", + "exchange_rate_label": "Tipo de Cambio (MXN/USD)", + "required_badge": "Requerida", + "consulting": "Consultando...", + "consult_dof": "Consultar DOF", + "example_suffix": "Ej.", + "cancel": "Cancelar", + "ok": "Ok", + "confirm_title": "¿Estás seguro?", + "confirm_description_create": "Se creará el tipo de cambio con valor {value} para el día {date}.", + "confirm_description_update": "Se actualizará el tipo de cambio con valor {value} para el día {date}.", + "confirm_action": "Confirmar", + "toast_dof_success": "Tipo de cambio obtenido del DOF: {value}", + "toast_dof_error": "No se pudo obtener el dato del DOF", + "toast_dof_service_error": "Error al consultar el servicio del DOF", + "error_no_company": "No hay una compañía seleccionada", + "error_date_required": "La fecha es requerida", + "error_value_required": "El tipo de cambio es requerido", + "error_value_positive": "El tipo de cambio debe ser un valor mayor a 0", + "toast_create_success": "Tipo de cambio creado correctamente", + "toast_update_success": "Tipo de cambio actualizado correctamente" + }, + "multi_currency": { + "new_title": "Nuevo Tipo de Cambio Múltiple", + "edit_title": "Editar Tipo de Cambio Múltiple", + "error_currency_required": "El código de moneda es requerido", + "error_date_required": "La fecha de publicación es requerida", + "currency_label": "Moneda", + "currency_help": "Código de moneda (FK).", + "country_label": "País", + "country_help": "Clave M3 del país (FK).", + "date_label": "Fecha", + "date_help": "Se guarda como entero (YYYYMMDD).", + "factor_label": "Factor", + "saving": "Guardando...", + "update": "Actualizar", + "create": "Crear" + }, "sidebar": { "dashboard": "Dashboard", "reference_data": { diff --git a/frontend/src/lib/components/dashboard/activity-feed.svelte b/frontend/src/lib/components/dashboard/activity-feed.svelte index 9f501382..0e51198a 100644 --- a/frontend/src/lib/components/dashboard/activity-feed.svelte +++ b/frontend/src/lib/components/dashboard/activity-feed.svelte @@ -11,6 +11,8 @@ AlertCircle, TruckIcon } from 'lucide-svelte'; + import { m } from '$lib/i18n/messages'; + import { getLocale } from '$lib/paraglide/runtime'; interface Props { activities: ActivityItem[]; @@ -48,7 +50,7 @@ // Si la fecha es futura (diff negativo) o muy reciente, mostrar 'Ahora mismo' if (diffMs < 0) { - return 'Ahora mismo'; + return m.dashboard_just_now(); } const diffMins = Math.floor(diffMs / 60000); @@ -56,15 +58,16 @@ const diffDays = Math.floor(diffMs / 86400000); if (diffMins < 1) { - return 'Ahora mismo'; + return m.dashboard_just_now(); } else if (diffMins < 60) { - return `Hace ${diffMins} min`; + return `${m.dashboard_ago_suffix()} ${diffMins} ${m.dashboard_min_short()}`; } else if (diffHours < 24) { - return `Hace ${diffHours}h`; + return `${m.dashboard_ago_suffix()} ${diffHours}${m.dashboard_h_short()}`; } else if (diffDays < 7) { - return `Hace ${diffDays}d`; + return `${m.dashboard_ago_suffix()} ${diffDays}${m.dashboard_d_short()}`; } else { - return date.toLocaleDateString('es-MX', { month: 'short', day: 'numeric' }); + const dateLocale = getLocale() === 'es' ? 'es-MX' : 'en-US'; + return date.toLocaleDateString(dateLocale, { month: 'short', day: 'numeric' }); } } @@ -75,12 +78,12 @@
- Actividad Reciente + {m.dashboard_recent_activity()} - Últimas operaciones registradas en el sistema + {m.dashboard_latest_operations()}
{#if activities.length > 0} - {activities.length} registros + {activities.length} {m.dashboard_records_suffix()} {/if} @@ -88,7 +91,7 @@ {#if activities.length === 0}
-

No hay actividad reciente

+

{m.dashboard_no_recent_activity()}

{:else}
diff --git a/frontend/src/lib/components/dashboard/chart-card.svelte b/frontend/src/lib/components/dashboard/chart-card.svelte index 7080bb2f..fd8df43b 100644 --- a/frontend/src/lib/components/dashboard/chart-card.svelte +++ b/frontend/src/lib/components/dashboard/chart-card.svelte @@ -1,6 +1,7 @@