Skip to content

Fix: translate the text widgets write themselves - #173

Merged
SandObserver merged 2 commits into
mainfrom
fix/widget-text-translation
Aug 30, 2026
Merged

SandObserver merged 2 commits into
mainfrom
fix/widget-text-translation

Conversation

@SandObserver

Copy link
Copy Markdown
Owner

Summary

  • Route the GitHub Pull Requests small-size caption through wt('view.prs.label') instead of a hardcoded English literal.
  • Format the visible date line in both clock styles with a short Intl.DateTimeFormat, replacing the hardcoded English day and month arrays. The accessible label already used Intl.
  • Add a check that scans every widget for text assigned to textContent without a catalog lookup, skipping injected stylesheets, markup and interpolated values.
  • Add a check that pins both clock styles to Intl and asserts every locale translates the pull request caption.

Testing
All green, plus the Docker build. Added 3 tests covering the widget text scan, the clock date formatting and the caption lookup across all six locales.

Checklist

  • Stays within the project constraints: one container, no runtime dependencies, no build step (see CONTRIBUTING.md).
  • Tests added or updated for new logic, and the full suite, lint, and typechecks pass.
  • Docs updated if behavior or configuration changed.
  • CHANGELOG.md updated under Unreleased if the change is user-visible.

The Pull Requests caption and both clock date lines rendered English on
every translated dashboard. Route the caption through the widget catalog
and format the clock date with Intl.

Add a check that scans every widget for display text written without a
lookup, so the same class of miss fails the suite.
@SandObserver SandObserver added bug Something isn't working ui/ux UI, UX, and accessibility only fix labels Aug 30, 2026
Comment thread ui/test/widget-i18n.test.mjs Fixed
Stripping tags to find words reads as a sanitiser and matches
js/incomplete-multi-character-sanitization. The scan only needs to tell
prose from markup, so it skips a literal that carries either.
@SandObserver
SandObserver merged commit 18b94eb into main Aug 30, 2026
4 checks passed
@SandObserver
SandObserver deleted the fix/widget-text-translation branch August 30, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ui/ux UI, UX, and accessibility only fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants