Skip to content

frontend: Localize the GPU status summary and causes (#945) - #999

Closed
zackees wants to merge 2 commits into
masterfrom
feat/945-localize-gpu-status
Closed

zackees wants to merge 2 commits into
masterfrom
feat/945-localize-gpu-status

Conversation

@zackees

@zackees zackees commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Fixes #945 (part of #939).

The light's tooltip, title and labels already came from en-US.ini, but the dialog's summary and causes were English text from rust/obs-gpu-status, out of translators' reach.

Change

  • Report: next to the English summary and causes, it now carries summaryKey plus summaryArgs (filled in as %1, %2, …) and causeKeys, in both the struct and the JSON.
  • Frontend: Localized() renders each key with App()->TranslateString and QString::arg. If a key is missing it falls back to the English text.
  • en-US.ini: 5 summary strings and 3 cause strings.
  • GetStats.gpuAcceleration.summary and causes stay English, so the obs-websocket output does not change.

RED → GREEN

  • RED c5504c6: 2 tests fail on todo!().
  • GREEN 06d8976: every_summary_and_cause_has_an_en_us_string_matching_the_english_text reads frontend/data/locale/en-US.ini, fills each template with the report's arguments, and requires Rust's English text exactly, for all five states. The locale and the code cannot drift apart.
  • All obs-gpu-status tests pass, clippy is clean, and GpuStatus.cpp compiles cleanly with -Wall against OBSApp.hpp.

@zackees
zackees enabled auto-merge October 16, 2026 06:10
@zackees
zackees added this pull request to the merge queue Oct 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 16, 2026
The dialog's summary and causes were English only. The report must name
a locale key and arguments for each, and the en-US strings must match
the English JSON exactly.

Refs #945
The report now carries summaryKey/summaryArgs and causeKeys next to the
English text; the dialog renders them from the locale (falling back to
the English text), and en-US.ini gains the strings. A Tier 1 test fills
each en-US template with the report's args and requires the English JSON
exactly, so the two cannot drift. GetStats' summary and causes stay
English.

Fixes #945
@zackees
zackees force-pushed the feat/945-localize-gpu-status branch from 06d8976 to f9bf823 Compare October 16, 2026 06:56
@zackees
zackees enabled auto-merge October 16, 2026 06:57
@zackees

zackees commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

Landed on master through #1006 (a0955fb), which was stacked on this PR and was squash-merged first. Its diff includes this PR's localization: tests/locale.rs, the en-US.ini summary and cause strings, and Localized() in GpuStatus.cpp. Closing as merged.

@zackees zackees closed this Oct 16, 2026
auto-merge was automatically disabled October 16, 2026 07:07

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

feat: Localize the GPU status summary and causes

1 participant