Skip to content

2.1: Comprehensive hard-coded label localization audit and remediation #220

@hessius

Description

@hessius

Summary

A comprehensive frontend review found a significant set of user-facing strings still hard-coded in the web app instead of using i18n keys.

This affects localization quality (notably EN/SV consistency), creates translation drift risk, and increases maintenance overhead.

Scope reviewed

  • apps/web/src/views/**
  • apps/web/src/components/**
  • apps/web/src/App.tsx
  • Included text nodes, title, aria-label, placeholder, and toast messages.
  • Excluded tests/stories from actionable scope.

Findings (by area)

1) Pour-over flow (recently changed)

  • apps/web/src/components/PourOverView.tsx
    • Hard-coded labels/help text such as: Brewing mode, Manual controls, Ratio setup, Target water, Remaining, Progress, Auto-start timer, Bloom indicator.
    • Hard-coded accessibility/tooltips: aria-label="Back", title="Reset timer to 00:00", title="Zero the scale reading", aria-label="Weight trend".
    • Hard-coded placeholders: 20, 15, 30.

2) Start/form/results/navigation surfaces

  • apps/web/src/views/FormView.tsx
  • apps/web/src/views/ResultsView.tsx
  • apps/web/src/views/ErrorView.tsx
  • apps/web/src/App.tsx

3) Core feature components

  • apps/web/src/components/RunShotView.tsx
  • apps/web/src/components/HistoryView.tsx
  • apps/web/src/components/LlmAnalysisModal.tsx
  • apps/web/src/components/ProfileImportDialog.tsx
  • apps/web/src/components/QRCodeDialog.tsx
  • apps/web/src/components/ImageCropDialog.tsx
  • apps/web/src/components/charts/CustomTooltip.tsx

4) Settings and control-center-adjacent

  • apps/web/src/components/SettingsView.tsx
  • apps/web/src/components/ControlCenter.tsx

5) Reusable UI primitives (lower priority but user-facing)

  • apps/web/src/components/ui/* (sr-only and ARIA strings)

Proposed remediation plan (2.1.0)

  • Add missing i18n keys for all product-facing strings in EN + SV first.
  • Replace hard-coded strings in high-impact screens first: PourOverView, RunShotView, HistoryView, FormView, ResultsView, App.tsx.
  • Localize toast messages via key-based wrappers.
  • Localize accessibility attributes (aria-label, title, sr-only text).
  • Add CI guardrail to flag new hard-coded user-facing strings.

Acceptance criteria

  • No hard-coded user-facing strings remain in prioritized screens.
  • EN/SV parity confirmed for new keys.
  • Browser verification with 0 console errors on affected views.
  • Existing frontend tests pass; adjust tests where label text changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions