Commit Graph
1 Commits
Author SHA1 Message Date
2ed0c4db27 fix(i18n): route sidebar source-tab labels through t() (#7580) (#7602)
* fix(i18n): route sidebar source labels through t() (#7580)

_sessionSourceLabel() hardcoded the two visible tab labels as English
template literals and assigned the result straight to textContent, so
non-English locales rendered untranslated sidebar tabs. Route both
filters through t() with the established {0}-interpolation pattern
(same shape as kanban_comments_count) and add explicit en + ru keys
so English remains the fallback for locales without a translation.

- static/sessions.js: return t("sessions_source_cli", n) /
  t("sessions_source_webui", n) instead of template literals
- static/i18n.js: add the two keys to the en and ru bundles
- tests/test_issue2351_cli_session_source_filter.py: replace the
  hardcoded-English regressions with locale-key assertions and a new
  interpolation test; verify the template-literal fallback is gone
  so a regression can no longer ro-introduce it silently

* i18n(sessions-source): add source-tab labels to the remaining 13 locales

Codex gate: the runtime fallback is non-regressive, but the repo enforces a
locale key-parity contract — 9 parity tests failed because the two new keys
existed only in EN+RU. Add sessions_source_webui / sessions_source_cli to it,
ja, es, de, zh, zh-Hant, pt, ko, fr, cs, tr, pl, vi, matching each locale's
established translation of 'session' and preserving the {0} count placeholder.
Placed after each locale's _label line so the {0} literal does not fall inside
test_japanese_locale.py's brace-bounded _label regex.

Co-authored-by: Yularzhi <Yularzhi@users.noreply.github.com>

---------

Co-authored-by: nesquena-hermes <agent@hermes.local>
Co-authored-by: Yularzhi <Yularzhi@users.noreply.github.com>
2026-09-16 02:39:58 -07:00