fix: reduce excessive MISSING_TRANSLATION warnings for fallback locales#9294
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5b945fc2c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eb2c2bf873
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d58242c3c5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1218484f8e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return { | ||
| ...englishMessages, | ||
| ...messages, |
There was a problem hiding this comment.
Preserve source defaultMessage fallback for untranslated keys
Merging englishMessages into every non-English catalog causes untranslated keys to resolve from src/i18n/compiled/en.json instead of React Intl’s in-code defaultMessage, so copy can become stale when defaultMessage text changes but i18n:extract has not been rerun. In this repo, ui/desktop/package.json shows common startup paths (start-gui) run i18n:compile but not i18n:extract, so existing IDs with updated defaultMessage will display outdated English text for partially translated locales (for example zh-CN) without any warning. Fresh evidence: the new merge at these lines applies that compiled-English fallback to all non-English locales, not just en.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
i18n:check re-extracts messages and fails if en.json is stale, so CI should catch this. The English fallback is intentional to avoid missing-translation noise
|
Thanks for tracking this down! I'm worried though that if we spread the English catalog under all the other locales' catalogs, we lose the missing translation signal entirely, so we can't for example use telemetry to keep track of missing translations, translators can't use tooling to scan for missing translations, etc. I think a better approach would be a narrow fix for the problem, which as I understand it is "the emission of a warning message whenever a message is untranslated". We should be able to use the |
jh-block
left a comment
There was a problem hiding this comment.
lgtm! nice touch having it emit the warning once!
* origin/main: (160 commits) Add Linux musl CLI builds (#9240) feat(acp): paginate session list (#9199) docs: reorganize (#9310) Structured per-provider config block, non-destructive provider switching (#8977) feat(cli): add `goose review` local code review command (#9114) feat(tui): diff viewer (#9260) fix(otel): emit trace_output as span attribute instead of event (#9255) docs: add guide for connecting goose Desktop to a remote goosed server (#9275) fix(config): check file fallback when keyring has no entry (#9279) fix(desktop): ScheduleModal error message styling (#9278) fix(ui): align sidebar hamburger in macOS fullscreen (#9257) Add documentation for new provider SaladCloud AI Gateway (#9253) fix: use current_exe() instead of PATH lookup when spawning goose (#9236) fix(extension_manager): set TCP_USER_TIMEOUT on streamable HTTP clients (#9207) fix: activate custom provider after adding via configure (#9213) Flush OTLP traces reliably on exit with configurable timeout (#9228) fix: reduce excessive MISSING_TRANSLATION warnings for fallback locales (#9294) feat(acp): pass session cwd param to acp providers (#9229) fix(desktop): eliminate cross-window deep link contamination (#9273) fix: improve Telegram gateway error reporting and connection reliability (#9223) ... Signed-off-by: Michael Neale <michael.neale@gmail.com> # Conflicts: # crates/goose/src/agents/agent.rs # crates/goose/tests/agent.rs
Summary
When the locale is not supported. The UI itself displays correctly, but only the console is noisy, it prints many warnings. This makes debugging for other issues hard
Cause
loadMessagesreturned{}for English, relying on react-intl'sdefaultMessagefallback. But when the user's locale is not supported, react-intl considers them different and emitsMISSING_TRANSLATIONfor every key not in the catalog.Fix
Only show the warning message once if the locale is not the same as fallback locale
Testing
manual testing