From 41cd9c096cc30078df6b04aa175e26ce37205faf Mon Sep 17 00:00:00 2001 From: Olivier Date: Mon, 18 May 2026 18:31:31 +0200 Subject: [PATCH] =?UTF-8?q?i18n:=20pass=20all=20visible=20UI=20strings=20t?= =?UTF-8?q?hrough=20t()=20=E2=80=94=20no=20more=20hardcoded=20labels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move Link, GW, LXC, VM chip tags, WAN labels, form placeholders, and confirm-dialog delete verbs into i18n.js for all three locales (fr/en/es). confirmDeleteDevice and confirmDeleteNetwork now include the action verb so the JS callers no longer hardcode "Supprimer". Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/components/DeviceManager.vue | 8 ++--- frontend/src/components/TopologyGraph.vue | 14 ++++----- frontend/src/components/VlanManager.vue | 4 +-- frontend/src/i18n.js | 36 +++++++++++++++++++---- 4 files changed, 43 insertions(+), 19 deletions(-) diff --git a/frontend/src/components/DeviceManager.vue b/frontend/src/components/DeviceManager.vue index 85e8e57..573f595 100644 --- a/frontend/src/components/DeviceManager.vue +++ b/frontend/src/components/DeviceManager.vue @@ -142,7 +142,7 @@ {{ vlanLabel(iface.vlan_id) }} - ↑ WAN + {{ t('wanUpstreamTag') }} @@ -156,7 +156,7 @@
- +
@@ -213,7 +213,7 @@
@@ -434,7 +434,7 @@ async function save() { } async function remove(device) { - if (!confirm(`Supprimer ${tFmt('confirmDeleteDevice', device.name)}`)) return + if (!confirm(tFmt('confirmDeleteDevice', device.name))) return try { await devicesApi.remove(device.id) emit('refresh') diff --git a/frontend/src/components/TopologyGraph.vue b/frontend/src/components/TopologyGraph.vue index 21b5ed7..8733579 100644 --- a/frontend/src/components/TopologyGraph.vue +++ b/frontend/src/components/TopologyGraph.vue @@ -32,7 +32,7 @@
- Link + {{ t('tagLink') }} @@ -53,7 +53,7 @@ - Link + {{ t('tagLink') }} @@ -101,10 +101,10 @@
- Link - GW - LXC - VM + {{ t('tagLink') }} + {{ t('tagGw') }} + {{ t('tagLxc') }} + {{ t('tagVm') }}
@@ -139,7 +139,7 @@ - Link + {{ t('tagLink') }} diff --git a/frontend/src/components/VlanManager.vue b/frontend/src/components/VlanManager.vue index b366f27..6fcbf89 100644 --- a/frontend/src/components/VlanManager.vue +++ b/frontend/src/components/VlanManager.vue @@ -51,7 +51,7 @@
- +
@@ -154,7 +154,7 @@ function _affectedCount(vlan) { async function remove(vlan) { const label = vlan.vlan_id != null ? `VLAN ${vlan.vlan_id} — ${vlan.name}` : `LAN ${vlan.name}` const count = _affectedCount(vlan) - let msg = `Supprimer ${tFmt('confirmDeleteNetwork', label)}` + let msg = tFmt('confirmDeleteNetwork', label) if (count > 0) msg += '\n' + tFmt('confirmDeleteNetworkHosts', count) if (!confirm(msg)) return try { diff --git a/frontend/src/i18n.js b/frontend/src/i18n.js index 1026d93..8257d81 100644 --- a/frontend/src/i18n.js +++ b/frontend/src/i18n.js @@ -36,6 +36,10 @@ const LANGS = { reachable: 'Joignable', unreachable: 'Injoignable', openWebUI: "Ouvrir l'interface web", + tagLink: 'Link', + tagGw: 'GW', + tagLxc: 'LXC', + tagVm: 'VM', // DeviceManager devices: 'Équipements', addDevice: '+ Ajouter un équipement', @@ -68,12 +72,16 @@ const LANGS = { create: 'Créer', badgeGateway: 'Passerelle', badgeLivebox: 'Livebox', - confirmDeleteDevice: '{0} et tous ses liens ?', - confirmDeleteNetwork: '{0} ?', + confirmDeleteDevice: 'Supprimer {0} et tous ses liens ?', + confirmDeleteNetwork: 'Supprimer {0} ?', confirmDeleteNetworkHosts: '{0} équipement(s) hors passerelle seront également supprimés.', saveError: 'Erreur lors de la sauvegarde', deleteError: 'Erreur lors de la suppression', descPlaceholder: 'Rôle, OS, notes…', + wanLabel: 'WAN', + wanUpstreamTag: '↑ WAN', + deviceNamePlaceholder: 'ex: srv-web-01', + networkNamePlaceholder: 'ex: Serveurs', // Device types typeServer: 'Serveur', typeSwitch: 'Switch', @@ -201,6 +209,10 @@ const LANGS = { reachable: 'Reachable', unreachable: 'Unreachable', openWebUI: 'Open web interface', + tagLink: 'Link', + tagGw: 'GW', + tagLxc: 'LXC', + tagVm: 'VM', devices: 'Devices', addDevice: '+ Add device', noDevicesConfigured: 'No devices configured. Start by adding one.', @@ -232,12 +244,16 @@ const LANGS = { create: 'Create', badgeGateway: 'Gateway', badgeLivebox: 'ISP Box', - confirmDeleteDevice: '{0} and all its links?', - confirmDeleteNetwork: '{0}?', + confirmDeleteDevice: 'Delete {0} and all its links?', + confirmDeleteNetwork: 'Delete {0}?', confirmDeleteNetworkHosts: '{0} non-gateway device(s) will also be deleted.', saveError: 'Error while saving', deleteError: 'Error while deleting', descPlaceholder: 'Role, OS, notes…', + wanLabel: 'WAN', + wanUpstreamTag: '↑ WAN', + deviceNamePlaceholder: 'e.g. srv-web-01', + networkNamePlaceholder: 'e.g. Servers', typeServer: 'Server', typeSwitch: 'Switch', typeRouter: 'Router', @@ -361,6 +377,10 @@ const LANGS = { reachable: 'Alcanzable', unreachable: 'No alcanzable', openWebUI: 'Abrir interfaz web', + tagLink: 'Link', + tagGw: 'GW', + tagLxc: 'LXC', + tagVm: 'VM', devices: 'Equipos', addDevice: '+ Añadir equipo', noDevicesConfigured: 'No hay equipos configurados. Empiece añadiendo uno.', @@ -392,12 +412,16 @@ const LANGS = { create: 'Crear', badgeGateway: 'Pasarela', badgeLivebox: 'Router ISP', - confirmDeleteDevice: '{0} y todos sus enlaces?', - confirmDeleteNetwork: '{0}?', + confirmDeleteDevice: 'Eliminar {0} y todos sus enlaces?', + confirmDeleteNetwork: 'Eliminar {0}?', confirmDeleteNetworkHosts: '{0} equipo(s) no gateway también serán eliminados.', saveError: 'Error al guardar', deleteError: 'Error al eliminar', descPlaceholder: 'Rol, SO, notas…', + wanLabel: 'WAN', + wanUpstreamTag: '↑ WAN', + deviceNamePlaceholder: 'ej: srv-web-01', + networkNamePlaceholder: 'ej: Servidores', typeServer: 'Servidor', typeSwitch: 'Switch', typeRouter: 'Router',