fix(chat): translate the live run-status indicator copy - #5545
Merged
Conversation
The 10 run-status stages (sending, received, waiting-runner, ...) rendered their label/detail directly from hardcoded English strings in run-status.ts, bypassing i18n entirely — every pt-br user saw English text while a run was in flight.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Source: bug found while auditing the chat hot-reload/resilience area (
apps/web/src/components/chat/) — not tied to a specific issue.Payoff:
RUN_STATUS_COPYinrun-status.tshardcoded the label/detail for all 10 run-status stages ("Sending your message", "Message received", "Waiting to start", ... rendered live inRunStatusIndicatorviathinking-indicator.tsx) directly in English, bypassing the i18n layer the rest of the chat UI uses. Every pt-br user watching a run progress saw English text mixed into an otherwise-translated chat surface — this is the same class of hardcoded-string bug as the repo's recurring i18n merge lane (#5099, #5373, #5479, etc).Fix: moved the 20 strings into
i18n/en/chat.ts/i18n/pt-br/chat.tsunderchat.runStatus.*, and replaced the staticRUN_STATUS_COPYrecord withgetRunStatusCopy(t, stage), a pure helper that takes theTFunctionand returns the translated{ label, detail }— called fromRunStatusIndicator(which already hast = useT()) instead of indexing the old hardcoded map. No behavior change for non-translation logic (advanceRunStatusStage,parseRunStatusStageChunk, etc. are untouched).Verify:
cd apps/web && bunx tsc --noEmit(also proves en/pt-br key parity via thesatisfies Record<keyof typeof chatEn, string>check on the pt-br dictionary)bun test apps/web/src/components/chat/run-status.test.ts— updated to callgetRunStatusCopy(translate, stage)instead of indexing the old static map; still asserts the exact copy forwaiting-runner/analyzing-scopebunx oxlinton all 5 changed files: 0 warnings/errorsbun run fmt— cleanCI runs the full suite; these are the targeted checks covering this change.
Summary by cubic
Localized the live run-status indicator by moving hardcoded English strings into i18n and using
getRunStatusCopy(t, stage), fixing mixed-language UI for pt-br users with no logic changes.chat.runStatus.*keys toi18n/en/chat.tsandi18n/pt-br/chat.tsfor all 10 stages (label + detail).RUN_STATUS_COPYwithgetRunStatusCopy(t, stage)and updatedRunStatusIndicatorto use it.getRunStatusCopywithtranslateand assert expected copy.Written for commit f290547. Summary will update on new commits.