Forráskód Böngészése

feat(ui,i18n): upstream the UI/i18n group from the borky fork (#938) (#941)

* feat(i18n): English is what the panel shows unless asked otherwise

The UI followed the browser when nobody had chosen a language, so a
Spanish or Romanian locale opened the panel in Spanish. English is now
the default; index.html declares it too, so the browser stops offering
to translate the page and mangling hostnames along the way. Choosing a
language in Settings still wins, and choosing "Auto" there goes back to
following the browser. The selector shows English instead of "Auto"
when nothing has been chosen, because that is what is happening.

Three canonical strings from the server were reaching the screen
untranslated, each with a helper that existed and was not used, or that
had no case for them:

  - the gateway's role badge on the map ("Principal"), the one place
    that printed it without roleLabel
  - a WireGuard peer that has never handshaked ("nunca")
  - the health breakdown labels ("AdGuard inactivo", "temp. <router>",
    "<router> offline"), built by concatenation server-side and matched
    by shape, passing anything unrecognised through untouched

And two hardcoded Spanish strings in components: the 404 title and the
"IP túnel" label in the alert detail.

Checked and clean: the two catalogues have the same keys, with no
Spanish left in the English one, and health.caption / health.note are
Spanish in the payload but rendered nowhere.

(cherry picked from commit f9b469609003f219eab1893b902e6f0cce1b90c3)

* feat(devices): show which AP or switch each client hangs off

The clients list only named the router, which says "OpenWrt" for every
device in the house — true, and useless once there is a switch and a
couple of APs between them. The data was already there in attachTo and
the map was already drawing it; the list was not showing it.

Each row now carries a "via <box>" line under the router chip: the AP a
station is associated to, the switch a wired client sits on, or the
hypervisor a container runs in. The expanded detail adds a "Connected
to" row with the port as well, and the same line appears on the grid
cards and in a router's own client list.

Resolved through one shared hook, since attachTo points at either a
distribution node or another device acting as a hub, and both have to
be looked up. Nothing is shown when nothing is known: a client whose
only evidence is the router keeps just the router chip.

On a live fleet that labels 45 of 46 clients, spread across two
access points, a switch and a hypervisor host.

(cherry picked from commit 06e53c4e2f85e3004d3c65c27d6e87e44534b317)

* fix(devices): leaving a device anonymous no longer says it was identified

From the borky community fork (3621c23, adapted without the unrelated
URL-parameter hunk): the identify dialog reports back through one
callback for both choices, and the devices page answered it with
"Device identified" even when the user chose "Leave anonymous". The
callback now carries the outcome and the toast says what happened.

* fix(fork): give "Find this device" its own label key

The fork's link reused upstream's alerts.viewDevice key, so both locale
files defined it twice and upstream's "View device" won: the fork's
wording never showed. It now has its own key, and upstream's line is left
alone so later syncs do not conflict on it. Also replaces a comment that
still described the click opening the identify dialog.

(cherry picked from commit ddf8865433a0363068246133cdf96b0e6159b84f)

---------

Co-authored-by: borky-git <borky-git@protonmail.com>
Nacho 2 hónapja
szülő
commit
4727364dbd

+ 1 - 1
app/index.html

@@ -1,5 +1,5 @@
 <!doctype html>
-<html lang="es" class="dark">
+<html lang="en" class="dark">
   <head>
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />

+ 15 - 2
app/public/locales/en/translation.json

@@ -41,6 +41,10 @@
     "unreadCount_one": "unread alert",
     "unreadCount_other": "unread alerts",
     "viewRouter": "View router",
+    "findDevice": "Find this device",
+    "identifyDevice": "Identify this device",
+    "connectedTo": "Connected to",
+    "port": "Port",
     "wgPeerCaption": "WireGuard peer · wg0",
     "reason": {
       "temp": "temperature",
@@ -285,6 +289,9 @@
       "excellent": "Excellent",
       "good": "Good",
       "warning": "Warning",
+      "adguardInactive": "AdGuard inactive",
+      "routerOffline": "{{name}} offline",
+      "routerTemp": "{{name}} temperature",
       "subscores": {
         "wan": "WAN",
         "wifi": "Wi-Fi",
@@ -328,7 +335,10 @@
     "back": "Back",
     "cancel": "Cancel",
     "loading": "Loading...",
-    "save": "Save"
+    "save": "Save",
+    "never": "never",
+    "notFound": "Page not found",
+    "tunnelIp": "Tunnel IP"
   },
   "devices": {
     "badges": {
@@ -363,7 +373,8 @@
       "trafficCurrent": "Current traffic",
       "traffic": "Client traffic",
       "trafficNoSource": "No per-client traffic: wired clients need nlbwmon on the router (WiFi uses hostapd counters).",
-      "unfiltered": "Unfiltered"
+      "unfiltered": "Unfiltered",
+      "connectedTo": "Connected to"
     },
     "deviceType": "Device type",
     "emptyDesc": "No device matches these filters.",
@@ -400,6 +411,7 @@
       "auto": "Auto",
       "save": "Save",
       "saved": "Device updated",
+      "dismissed": "Left anonymous: its new-device alert is silenced",
       "saveError": "Could not save — please try again",
       "banTitle": "Block bands",
       "banHint": "Coming soon: block this device from 2.4/5/6 GHz networks.",
@@ -468,6 +480,7 @@
     },
     "wiredConnection": "Wired connection",
     "weakChip": "{{count}} with weak signal",
+    "via": "via {{name}}",
     "unknownManufacturer": "Unknown",
     "onboarding": {
       "title": "Identify device",

+ 15 - 2
app/public/locales/es/translation.json

@@ -41,6 +41,10 @@
     "unreadCount_one": "aviso sin leer",
     "unreadCount_other": "avisos sin leer",
     "viewRouter": "Ver router",
+    "findDevice": "Localizar este dispositivo",
+    "identifyDevice": "Identificar este dispositivo",
+    "connectedTo": "Conectado a",
+    "port": "Puerto",
     "wgPeerCaption": "Peer WireGuard · wg0",
     "reason": {
       "temp": "temperatura",
@@ -285,6 +289,9 @@
       "excellent": "Excelente",
       "good": "Bueno",
       "warning": "Atención",
+      "adguardInactive": "AdGuard inactivo",
+      "routerOffline": "{{name}} offline",
+      "routerTemp": "temp. {{name}}",
       "subscores": {
         "wan": "WAN",
         "wifi": "Wi-Fi",
@@ -328,7 +335,10 @@
     "back": "Atrás",
     "cancel": "Cancelar",
     "loading": "Cargando...",
-    "save": "Guardar"
+    "save": "Guardar",
+    "never": "nunca",
+    "notFound": "Página no encontrada",
+    "tunnelIp": "IP túnel"
   },
   "devices": {
     "badges": {
@@ -363,7 +373,8 @@
       "trafficCurrent": "Tráfico actual",
       "traffic": "Tráfico por cliente",
       "trafficNoSource": "Sin tráfico por cliente: los clientes por cable necesitan nlbwmon en el router (los WiFi usan los contadores de hostapd).",
-      "unfiltered": "Sin filtrar"
+      "unfiltered": "Sin filtrar",
+      "connectedTo": "Conectado a"
     },
     "deviceType": "Tipo de dispositivo",
     "emptyDesc": "Ningún dispositivo coincide con estos filtros.",
@@ -400,6 +411,7 @@
       "auto": "Auto",
       "save": "Guardar",
       "saved": "Dispositivo actualizado",
+      "dismissed": "Dejado anónimo: su alerta de dispositivo nuevo queda silenciada",
       "saveError": "No se pudo guardar — inténtalo de nuevo",
       "banTitle": "Bloquear bandas",
       "banHint": "Próximamente: impedir que se conecte a redes 2.4/5/6 GHz.",
@@ -468,6 +480,7 @@
     },
     "wiredConnection": "Conexión por cable",
     "weakChip": "{{count}} con señal débil",
+    "via": "vía {{name}}",
     "unknownManufacturer": "Desconocido",
     "onboarding": {
       "title": "Identificar dispositivo",

+ 9 - 1
app/src/App.tsx

@@ -1,3 +1,4 @@
+import { useTranslation } from 'react-i18next'
 import { Route, Routes } from 'react-router'
 import { Navigate } from 'react-router'
 import { AuthGate } from '@/components/AuthGate'
@@ -53,8 +54,15 @@ export default function App() {
         <Route path="orchestration" element={<Orchestration />} />
         <Route path="help" element={<Help />} />
         <Route path="settings" element={<Settings />} />
-        <Route path="*" element={<Placeholder title="Página no encontrada" />} />
+        <Route path="*" element={<NotFound />} />
       </Route>
     </Routes>
   )
 }
+
+/** 404: its own component so the title goes through i18n like every other
+ *  piece of text, instead of a hardcoded string in the route table. */
+function NotFound() {
+  const { t } = useTranslation()
+  return <Placeholder title={t('common.notFound')} />
+}

+ 7 - 5
app/src/components/OnboardingIntake.tsx

@@ -16,7 +16,9 @@ export interface OnboardingIntakeProps {
   device: ClientDevice | null
   isDemo: boolean
   onClose: () => void
-  onSaved: () => void
+  /** Qué elección se hizo, para que el caller diga lo que pasó de verdad:
+   *  "Leave anonymous" antes reportaba "Device identified" (borky fork). */
+  onSaved: (outcome: 'identified' | 'dismissed') => void
 }
 
 // Alta guiada de un dispositivo desconocido (#772): nombre (known_macs, que
@@ -69,7 +71,7 @@ export function OnboardingIntake({ open, device, isDemo, onClose, onSaved }: Onb
     setError(null)
     try {
       if (isDemo) {
-        onSaved()
+        onSaved('identified')
         onClose()
         return
       }
@@ -111,7 +113,7 @@ export function OnboardingIntake({ open, device, isDemo, onClose, onSaved }: Onb
           return
         }
       }
-      onSaved()
+      onSaved('identified')
       onClose()
     } finally {
       setBusy(false)
@@ -133,7 +135,7 @@ export function OnboardingIntake({ open, device, isDemo, onClose, onSaved }: Onb
           return
         }
       }
-      onSaved()
+      onSaved('dismissed')
       onClose()
     } finally {
       setBusy(false)
@@ -281,7 +283,7 @@ export function OnboardingIntake({ open, device, isDemo, onClose, onSaved }: Onb
                       await planRun?.()
                       setPlan(null)
                       setPlanRun(null)
-                      onSaved()
+                      onSaved('identified')
                       onClose()
                     } finally {
                       setPlanBusy(false)

+ 14 - 0
app/src/components/routers/RouterClients.tsx

@@ -12,6 +12,7 @@ import { SectionHeader } from '@/components/SectionHeader'
 import { buildClientDevices } from '@/pages/devices-data'
 import type { ClientDevice } from '@/pages/devices-data'
 import { cn, fetchJson } from '@/lib/utils'
+import { useParentName } from '@/lib/parent'
 
 const VISIBLE_COUNT = 6
 
@@ -174,6 +175,7 @@ export function RouterClients({ router }: { router: Router }) {
                       <div>
                         <div className="font-medium text-text-primary" translate="no">{d.name}</div>
                         <div className="text-caption text-text-muted">{manufacturerLabel(d.manufacturer)}</div>
+                        <ClientParent attachTo={d.attachTo} />
                       </div>
                     </div>
                   </td>
@@ -250,3 +252,15 @@ export function RouterClients({ router }: { router: Router }) {
     </section>
   )
 }
+
+/** "via <AP or switch>": which box this client hangs off, when we know it. */
+function ClientParent({ attachTo }: { attachTo?: string }) {
+  const { t } = useTranslation()
+  const parent = useParentName(attachTo)
+  if (!parent) return null
+  return (
+    <div className="truncate text-caption text-text-muted" title={parent}>
+      {t('devices.via', { name: parent })}
+    </div>
+  )
+}

+ 2 - 2
app/src/components/topology/TopologyMap.tsx

@@ -12,7 +12,7 @@ import { useNavigate } from 'react-router'
 import { animate, motion, useReducedMotion } from 'framer-motion'
 import { Cloud, Laptop, Router as RouterIcon, Server, Smartphone, Tag } from 'lucide-react'
 import { useTranslation } from 'react-i18next'
-import { manufacturerLabel, relTime } from '@/i18n'
+import { manufacturerLabel, relTime, roleLabel } from '@/i18n'
 import type { Device, DistributionNode, Router, WanInfo, WGPeer } from '@/data/mock'
 import { fmtEs } from '@/data/mock'
 import { StatusPill } from '@/components/StatusPill'
@@ -1454,7 +1454,7 @@ export function TopologyMap({
             <LabelText x={model.gatewayNode.label.x} y={model.gatewayNode.label.y} anchor={model.gatewayNode.label.anchor}
               delay={2.05 * T} reduce={reduce ?? false}
               title={model.gatewayNode.router.name}
-              sub={`${model.gatewayNode.router.modelShort} · ${model.gatewayNode.router.roleBadge} · ${t('common.clientsCount', { count: model.gatewayNode.router.clients })}`} />
+              sub={`${model.gatewayNode.router.modelShort} · ${roleLabel(model.gatewayNode.router.roleBadge)} · ${t('common.clientsCount', { count: model.gatewayNode.router.clients })}`} />
           )}
           {/* APs */}
           {model.apNodes.map((node, i) => (

+ 46 - 16
app/src/i18n.ts

@@ -3,28 +3,35 @@ import { initReactI18next } from 'react-i18next'
 import LanguageDetector from 'i18next-browser-languagedetector'
 import HttpBackend from 'i18next-http-backend'
 
-// 'auto' (o sin elección previa) => seguir al navegador: no debe quedar
-// idioma cacheado en localStorage por el detector
+// 'auto' means "follow the browser", and it is an explicit choice in
+// Settings: the detector must not keep a cached language for it.
 const savedLang = localStorage.getItem('netpulse-lang')
 if (!savedLang || savedLang === 'auto') {
   localStorage.removeItem('i18nextLng')
 }
 
-// Builds con idioma forzado (demo pública, VITE_FORCE_LANG=en): si el
-// visitante nunca eligió idioma, arrancar en el forzado en vez de seguir al
-// navegador. Una elección explícita en Ajustes (es/en/auto) siempre gana.
+// Builds with a forced language (public demo, VITE_FORCE_LANG=en).
 const forcedLang = import.meta.env.VITE_FORCE_LANG as 'es' | 'en' | undefined
-const initialLng = !savedLang && forcedLang ? forcedLang : (localStorage.getItem('i18nextLng') ?? undefined)
+// DEFAULT_LNG: English is the language this deployment shows unless somebody
+// asks for another. Following the browser as the default meant a Spanish or
+// Romanian locale opened the panel in Spanish, which is not what the people
+// running it read. A choice made in Settings still wins, and choosing 'auto'
+// there goes back to following the browser.
+const DEFAULT_LNG = 'en'
+const initialLng = savedLang
+  ? savedLang === 'auto'
+    ? undefined // explicit "follow the browser"
+    : savedLang
+  : (forcedLang ?? DEFAULT_LNG)
 
 i18n
   .use(HttpBackend)
   .use(LanguageDetector)
   .use(initReactI18next)
   .init({
-    // Sin elección previa NO se fija idioma: el LanguageDetector resuelve
-    // desde el navegador (orden localStorage → navigator). 'en' queda solo
-    // como fallback para locales no soportados. (issue #3)
-    // Excepción: builds con VITE_FORCE_LANG (demo pública, issue #237).
+    // With no previous choice the panel starts in English. Only an explicit
+    // 'auto' in Settings leaves this undefined so the LanguageDetector reads
+    // the browser (localStorage → navigator). (issue #3, #237)
     lng: initialLng,
     fallbackLng: 'en',
     supportedLngs: ['es', 'en'],
@@ -43,13 +50,12 @@ i18n
     returnNull: false,
   })
 
-// #666: el lang del documento debe seguir al idioma activo. index.html declara
-// lang="es"; si un usuario con la UI en inglés no lo actualizamos, el navegador
-// cree que la página es española y ofrece traducirla — y el traductor destroza
-// los datos (hostnames "crowed" → "crowded"). Con el lang correcto, la UI
-// traducida no dispara la oferta de traducción.
+// #666: the document's lang must follow the active language. Without it the
+// browser believes the page is in another language and offers to translate
+// it -- and the translator mangles the data (hostnames "crowed" →
+// "crowded"). With the right lang, a translated UI raises no such offer.
 const applyDocLang = (lng?: string) => {
-  const l = (lng ?? i18n.language ?? 'es').slice(0, 2).toLowerCase()
+  const l = (lng ?? i18n.language ?? DEFAULT_LNG).slice(0, 2).toLowerCase()
   document.documentElement.lang = l === 'en' ? 'en' : 'es'
 }
 applyDocLang()
@@ -69,6 +75,9 @@ const REL_RE_EN = /^(\d+)\s*(s|sec|min|h|hr|d|days?)\s+ago$/
 export function relTime(s: string): string {
   const t = s.trim()
   if (t === 'hoy' || t.toLowerCase() === 'today') return i18n.t('common.today')
+  // A peer that has never handshaked: the server sends the canonical
+  // Spanish and it was reaching the screen untranslated.
+  if (t === 'nunca' || t.toLowerCase() === 'never') return i18n.t('common.never')
   const m = REL_RE.exec(t) ?? REL_RE_EN.exec(t)
   if (!m) return s
   const n = Number(m[1])
@@ -160,3 +169,24 @@ const DAY_KEYS = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'] as const
 export function dayAbbr(index: number): string {
   return i18n.t(`common.days.${DAY_KEYS[((index % 7) + 7) % 7]}`)
 }
+
+const HEALTH_BREAKDOWN_RE = {
+  offline: /^(.+) offline$/,
+  temp: /^temp\. (.+)$/,
+}
+
+/**
+ * Canonical health-breakdown label from the server ("AdGuard inactivo",
+ * "temp. Patio", "Salon offline") → active language. These are built by
+ * concatenation server-side, so they are matched by shape, and anything
+ * unrecognised is passed through rather than mangled.
+ */
+export function healthBreakdownLabel(label: string): string {
+  const t = label.trim()
+  if (t === 'AdGuard inactivo') return i18n.t('common.health.adguardInactive')
+  const off = HEALTH_BREAKDOWN_RE.offline.exec(t)
+  if (off) return i18n.t('common.health.routerOffline', { name: off[1] })
+  const temp = HEALTH_BREAKDOWN_RE.temp.exec(t)
+  if (temp) return i18n.t('common.health.routerTemp', { name: temp[1] })
+  return label
+}

+ 21 - 0
app/src/lib/parent.ts

@@ -0,0 +1,21 @@
+import { useMemo } from 'react'
+import { useNetPulse } from '@/data/DataProvider'
+
+/**
+ * What a client actually hangs off: the AP or switch its controller reports,
+ * a hypervisor host, or null when the router is all we know.
+ *
+ * The router alone says "OpenWrt" for every client in the house, which is
+ * true and useless once there is a switch and a couple of APs in between.
+ * `attachTo` points at either a distribution node (switch, AP, hypervisor)
+ * or another device acting as a hub, so both are resolved here.
+ */
+export function useParentName(attachTo: string | undefined): string | null {
+  const { distributionNodes, devices } = useNetPulse()
+  return useMemo(() => {
+    if (!attachTo) return null
+    const node = distributionNodes.find((n) => n.id === attachTo)
+    if (node) return node.name ?? node.ip ?? null
+    return devices.find((d) => d.id === attachTo)?.name ?? null
+  }, [attachTo, distributionNodes, devices])
+}

+ 5 - 4
app/src/pages/Alerts.tsx

@@ -68,8 +68,9 @@ const SEVERITY: Record<AlertSeverity, { icon: LucideIcon; tile: string; dot: str
 
 const PEER_ICONS = { movil: Smartphone, portatil: Laptop, tablet: Tablet } as const
 
-// #827: la alerta de desconocido "atiende" directamente: el clic navega al
-// alta del dispositivo en vez de solo desplegar el panel de contexto.
+// FORK: the MAC an unknown-device alert can be identified by. Upstream (#827)
+// sent the click straight to the identify dialog; here the click expands the
+// alert, and this feeds its identify action and the row icon instead.
 const intakeMacOf = (ev: FeedEvent) => (ev.type === 'unknown-device' ? ev.vars?.mac : undefined)
 
 // ---------------------------------------------------------------------------
@@ -204,7 +205,7 @@ function ContextPanel({ ev, animateIn }: { ev: FeedEvent; animateIn: boolean })
           </div>
           <div className="grid gap-2 sm:grid-cols-3">
             <Fact label="Endpoint" value={c.wg.endpoint} />
-            <Fact label="IP túnel" value={c.wg.tunnelIp} />
+            <Fact label={t('common.tunnelIp')} value={c.wg.tunnelIp} />
             <Fact label="Handshake" value={relTime(c.wg.handshake)} />
           </div>
         </div>
@@ -238,7 +239,7 @@ function ContextPanel({ ev, animateIn }: { ev: FeedEvent; animateIn: boolean })
           }
           className="group inline-flex items-center gap-1 text-caption font-semibold text-accent transition-colors hover:text-accent/80"
         >
-          {t('alerts.viewDevice')}
+          {t('alerts.findDevice')}
           <ArrowRight className="h-3.5 w-3.5 transition-transform duration-150 group-hover:translate-x-0.5" strokeWidth={1.75} />
         </Link>
       )}

+ 32 - 3
app/src/pages/Devices.tsx

@@ -52,6 +52,7 @@ import { DeviceEditSheet } from '@/components/DeviceEditSheet'
 import { OnboardingIntake } from '@/components/OnboardingIntake'
 import { PresenceSection } from '@/components/PresenceTimeline'
 import { cn, copyToClipboard, fetchJson } from '@/lib/utils'
+import { useParentName } from '@/lib/parent'
 import type { ClientDevice, FilterGroup } from '@/pages/devices-data'
 import { buildClientDevices, GROUP_ORDER } from '@/pages/devices-data'
 import type { DeviceType } from '@/data/mock'
@@ -739,6 +740,7 @@ function DeviceDetail({
           )}
         </div>
       </div>
+      <ConnectedToItem device={device} />
       {infra && (
         <DetailItem label={t('devices.detail.infra')}>
           <InfraBadge info={infra} />
@@ -831,6 +833,31 @@ function NewPill() {
 }
 
 /** Chip de router con dot de identidad; navega a /routers/:id */
+/** "via <AP or switch>", under the router chip; nothing when unknown. */
+function ParentLine({ device, className }: { device: ClientDevice; className?: string }) {
+  const { t } = useTranslation()
+  const parent = useParentName(device.attachTo)
+  if (!parent) return null
+  return (
+    <div className={cn('truncate text-caption text-text-muted', className)} title={parent}>
+      {t('devices.via', { name: parent })}
+    </div>
+  )
+}
+
+/** Detail row: the parent box and, for a wired client, the port on it. */
+function ConnectedToItem({ device }: { device: ClientDevice }) {
+  const { t } = useTranslation()
+  const parent = useParentName(device.attachTo)
+  if (!parent) return null
+  const port = device.portLabel ?? device.port ?? ''
+  return (
+    <DetailItem label={t('devices.detail.connectedTo')}>
+      {port ? `${parent} · ${port}` : parent}
+    </DetailItem>
+  )
+}
+
 function RouterChipLink({ routerId, onNavigate }: { routerId: string; onNavigate: (id: string) => void }) {
   const { t } = useTranslation()
   const { routers } = useNetPulse()
@@ -982,9 +1009,10 @@ function ListRow({
         <div className="hidden lg:block">
           <LeaseCell device={device} />
         </div>
-        {/* Router */}
+        {/* Router, and the box the client actually hangs off */}
         <div className="min-w-0">
           <RouterChipLink routerId={device.routerId} onNavigate={onNavigateRouter} />
+          <ParentLine device={device} className="mt-0.5 pl-1" />
         </div>
         {/* Banda */}
         <div>
@@ -1121,6 +1149,7 @@ function GridCard({
           <RouterChipLink routerId={device.routerId} onNavigate={onNavigateRouter} />
           <BandChip band={device.band} />
         </div>
+        <ParentLine device={device} className="mt-1 pl-1" />
         <div className="mt-3 flex items-center justify-between gap-2 border-t border-border pt-3">
           <SignalBars device={device} />
           <span className="font-mono text-mono-sm text-accent">
@@ -1672,9 +1701,9 @@ export default function Devices() {
         device={allDevices.find((d) => d.id === intakeId) ?? null}
         isDemo={isDemo}
         onClose={() => setIntakeId(null)}
-        onSaved={() => {
+        onSaved={(outcome) => {
           refresh()
-          showToast(t('devices.onboarding.saved'))
+          showToast(t(outcome === 'dismissed' ? 'devices.onboarding.dismissed' : 'devices.onboarding.saved'))
         }}
       />
 

+ 6 - 2
app/src/pages/Settings.tsx

@@ -4304,10 +4304,14 @@ export default function Settings() {
     }
   }, [refreshOverview])
 
-  // ——— Idioma ('auto' por defecto sigue al navegador; elección explícita persistida) ———
+  // ——— Language ———
+  // With no explicit choice the panel runs in English (see i18n.ts), so the
+  // selector shows English rather than "Auto": it has to say what is
+  // actually happening. Picking "Auto" here still goes back to following
+  // the browser, and every choice is persisted.
   const [lang, setLang] = useState<'auto' | 'es' | 'en'>(() => {
     const raw = localStorage.getItem('netpulse-lang')
-    return raw === 'es' || raw === 'en' || raw === 'auto' ? raw : 'auto'
+    return raw === 'es' || raw === 'en' || raw === 'auto' ? raw : 'en'
   })
   const setLanguage = useCallback((v: 'auto' | 'es' | 'en') => {
     setLang(v)

+ 2 - 2
app/src/sections/HeroStrip.tsx

@@ -3,7 +3,7 @@ import { Fragment, useEffect, useState } from 'react'
 import { AlertTriangle, CheckCircle2, Gauge, MonitorSmartphone } from 'lucide-react'
 import { useTranslation } from 'react-i18next'
 import { cn } from '@/lib/utils'
-import { healthLabel, subscoreLabel } from '@/i18n'
+import { healthBreakdownLabel, healthLabel, subscoreLabel } from '@/i18n'
 import { CountUp } from '@/components/CountUp'
 import { HealthRing } from '@/components/HealthRing'
 import { StatusPill } from '@/components/StatusPill'
@@ -191,7 +191,7 @@ export function HeroStrip() {
                   transition={{ duration: 0.3, delay: 0.4 + i * 0.08 }}
                   className="flex items-center gap-2"
                 >
-                  <span className="w-28 shrink-0 truncate text-right text-[11px] text-text-muted">{b.label}</span>
+                  <span className="w-28 shrink-0 truncate text-right text-[11px] text-text-muted">{healthBreakdownLabel(b.label)}</span>
                   <div className="relative h-2 flex-1 overflow-hidden rounded-full bg-border/50">
                     <motion.div
                       className={cn('absolute left-0 top-0 h-full rounded-full', color)}