From a41ea32edacf25650c13a4d49a2b2ebd92566a29 Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 25 Sep 2026 10:08:49 +0200 Subject: [PATCH 1/3] fix(frontend): remaining Spanish copy (chart aria-label and chart caption) plus a sweep script for the English-only UI rule --- frontend/src/screens/EvalsScreen.tsx | 2 +- frontend/src/screens/OpsScreen.tsx | 2 +- scripts/sweep_spanish_ui.py | 52 ++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 scripts/sweep_spanish_ui.py diff --git a/frontend/src/screens/EvalsScreen.tsx b/frontend/src/screens/EvalsScreen.tsx index d242709..1dd4553 100644 --- a/frontend/src/screens/EvalsScreen.tsx +++ b/frontend/src/screens/EvalsScreen.tsx @@ -39,7 +39,7 @@ export function EvalsScreen() { diff --git a/frontend/src/screens/OpsScreen.tsx b/frontend/src/screens/OpsScreen.tsx index a778ca6..c868168 100644 --- a/frontend/src/screens/OpsScreen.tsx +++ b/frontend/src/screens/OpsScreen.tsx @@ -77,7 +77,7 @@ export function OpsScreen() { values={metrics.costHistory} ariaLabel="Daily LLM cost" leftCaption="14 days ago" - rightCaption="hoy" + rightCaption="today" />
diff --git a/scripts/sweep_spanish_ui.py b/scripts/sweep_spanish_ui.py new file mode 100644 index 0000000..a48a208 --- /dev/null +++ b/scripts/sweep_spanish_ui.py @@ -0,0 +1,52 @@ +"""One-off sweep: finds Spanish-looking UI string literals in the frontend. + +Usage: cd frontend/src && python ../../scripts/sweep_spanish_ui.py +Kept in the repo as a small guard for the English-only UI rule (spec §0 rule 1). +""" + +import io +import os +import re + +# Words that indicate Spanish UI copy (WhatsApp message bodies are the +# intentional exception: employee/manager facing, es-ES per spec). +SPANISH = re.compile( + r"\b(hoy|ayer|mensaje[s]?|emplead[oa]s?|confianza|modelo|coste|latencia|" + r"atascad[oa]|fallo|entrega|tasa|umbral|barra|sala|cocina|limpieza|" + r"encargad[oa]|oleada[s]?|silencio|guardar|pendiente[s]?|rescate[s]?|" + r"ajustes|equidad|proximidad|preferencia|vacaciones|puede[s]?|puedo|" + r"responde|gracias|recuerda|resumen|ultima|eventos|encuentro|fatal|" + r"desde|hasta)\b", + re.IGNORECASE, +) +LITERAL = re.compile(r"'([^'\n]{3,})'|\"([^\"\n]{3,})\"") +SKIP_PREFIXES = ("*", "//", "import", "export type", "className", "@") +WHATSAPP_CONTENT_FILE = "./services/dashboardMock.ts" + + +def main() -> None: + findings = 0 + for root, _, files in os.walk("."): + if "node_modules" in root: + continue + for name in sorted(files): + if not name.endswith((".ts", ".tsx")) or ".test." in name: + continue + path = os.path.join(root, name).replace(os.sep, "/") + for lineno, line in enumerate( + io.open(path, encoding="utf8").read().split("\n"), 1 + ): + if line.strip().startswith(SKIP_PREFIXES): + continue + for match in LITERAL.finditer(line): + value = match.group(1) or match.group(2) or "" + if not SPANISH.search(value): + continue + findings += 1 + tag = "WHATSAPP-OK" if path == WHATSAPP_CONTENT_FILE else "REVIEW" + print(f"[{tag}] {path}:{lineno} {value[:80]}") + print(f"total strings flagged: {findings}") + + +if __name__ == "__main__": + main() From ccf7fcaa45399c9699f88cf7b2c1bdb0ac9b86cb Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 25 Sep 2026 10:11:56 +0200 Subject: [PATCH 2/3] fix(frontend): English copy in template literals the scanner and earlier greps missed; sweep now covers backticks --- frontend/src/screens/ApprovalsScreen.tsx | 2 +- frontend/src/screens/EvalsScreen.tsx | 4 ++-- frontend/src/screens/OpsScreen.tsx | 2 +- frontend/src/screens/SettingsScreen.tsx | 2 +- frontend/src/screens/SimulatorScreen.tsx | 4 ++-- scripts/sweep_spanish_ui.py | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/src/screens/ApprovalsScreen.tsx b/frontend/src/screens/ApprovalsScreen.tsx index e7a1a69..002eba2 100644 --- a/frontend/src/screens/ApprovalsScreen.tsx +++ b/frontend/src/screens/ApprovalsScreen.tsx @@ -6,7 +6,7 @@ function ApprovalItem({ approval }: { approval: ApprovalRequest }) { const { decide, isPending } = useDecideApproval() const description = approval.context.detail ? `${approval.context.employeeName} — ${approval.context.detail}` - : `${approval.context.employeeName}, turno ${approval.context.shiftTime}` + : `${approval.context.employeeName}, shift ${approval.context.shiftTime}` return (
  • diff --git a/frontend/src/screens/EvalsScreen.tsx b/frontend/src/screens/EvalsScreen.tsx index 1dd4553..c97a96c 100644 --- a/frontend/src/screens/EvalsScreen.tsx +++ b/frontend/src/screens/EvalsScreen.tsx @@ -40,8 +40,8 @@ export function EvalsScreen() { values={evalRun.accuracyHistory} reference={evalRun.threshold} ariaLabel="Intent accuracy evolution" - leftCaption={`umbral ${evalRun.threshold}`} - rightCaption={`actual ${evalRun.latestAccuracy}`} + leftCaption={`threshold ${evalRun.threshold}`} + rightCaption={`current ${evalRun.latestAccuracy}`} />

    Per-scenario results

      diff --git a/frontend/src/screens/OpsScreen.tsx b/frontend/src/screens/OpsScreen.tsx index c868168..ccbb38d 100644 --- a/frontend/src/screens/OpsScreen.tsx +++ b/frontend/src/screens/OpsScreen.tsx @@ -58,7 +58,7 @@ export function OpsScreen() {