Skip to content

Operator fault panel: Thai translation with EN/ไทย toggle#25

Merged
PaulSalaun merged 1 commit into
masterfrom
feat/htf-thai-translation
Jul 7, 2026
Merged

Operator fault panel: Thai translation with EN/ไทย toggle#25
PaulSalaun merged 1 commit into
masterfrom
feat/htf-thai-translation

Conversation

@PaulSalaun

@PaulSalaun PaulSalaun commented Jul 7, 2026

Copy link
Copy Markdown

What

Adds Thai to the red operator fault panel so Calcomp operators can read remediation steps without outside help.

  • OutcomeDetails.description_th (optional, default None) — the Thai variant of a fault's panel text. It reaches the browser through the existing as_base_types()/websocket path automatically. It is GUI-only: the framework strips it from the JSON report before shipping (see companion hardware-test-framework PR), so Manufacturing Service / Calcomp / Athena payloads are byte-identical to today.
  • EN/ไทย toggle in the panel header — global (one setting for the whole GUI), persisted per browser in localStorage (htf-fault-panel-language). Default English.
  • Static labels (header, "What to do", escalate hint, button states) are hardcoded bilingual in the component (PANEL_LABELS).
  • Per-fault text (title/steps) comes translated from the fault catalogue (titleThai/stepsThai, authored in Farmhand). Each part falls back to English independently when no Thai exists, so untranslated entries render exactly as before.
  • station-data.ts splits description_th on the same literal What to do: machine marker as the English text (Farmhand normalises Thai marker variants back to the English marker on save).
  • Fixes in passing: test-summary.component.ts contained a stray NUL byte that made git treat it as binary; removed.

Backwards compatibility

  • add_outcome_details() keeps its old 2-arg signature; description_th is optional.
  • Faults with no Thai translation are untouched end-to-end (no description_th, English panel).
  • Rebased on the consolidated master (Consolidate Deployed Changes with Master + labelling change #24): coexists with the multislot history label — dist/ rebuilt from current master + this change (bundle e5169df5).

Testing

  • Deployed to hq-1500 (staging-tools): toggle shows, static labels switch EN/TH, catalogue entries with stepsThai render fully in Thai, untranslated entries fall back to English.
  • Framework-side unit tests (18) green in the companion PR.

Companion PRs

Adds an optional Thai variant of each fault's text to the red operator
fault panel, so Calcomp operators can read remediation steps in Thai.

- OutcomeDetails gains an optional description_th field. It rides to the
  browser via the existing as_base_types()/websocket path and is meant
  for the GUI only — the framework strips it from the JSON report before
  shipping, so downstream consumers (Manufacturing Service, Calcomp,
  Athena) are unchanged.
- The panel header gets a global EN/ไทย toggle, persisted per browser in
  localStorage (htf-fault-panel-language). Static panel labels are
  hardcoded bilingual; per-fault title/steps come from the catalogue's
  titleThai/stepsThai and fall back to English per part when missing.
- station-data parses description_th with the same literal 'What to do:'
  machine marker as the English text.
- test-summary.component.ts previously contained a stray NUL byte that
  made git treat it as binary; this commit removes it.
- dist/ rebuilt (bundle e5169df5).
@coveralls

coveralls commented Jul 7, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 28837558050

Coverage increased (+0.005%) to 60.612%

Details

  • Coverage increased (+0.005%) from the base build.
  • Patch coverage: 2 of 2 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 7741
Covered Lines: 4692
Line Coverage: 60.61%
Coverage Strength: 3.03 hits per line

💛 - Coveralls

@PaulSalaun
PaulSalaun merged commit 38cd660 into master Jul 7, 2026
20 of 21 checks passed
@PaulSalaun
PaulSalaun deleted the feat/htf-thai-translation branch July 7, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants