feat(desktop): add i18n infrastructure with react-intl#8105
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89ebe1f6c8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@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: 89c3c86da1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
e2b6678 to
d3bba30
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3bba30d41
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@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: 8f3ebe079e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| }, | ||
| templateVarHint: { | ||
| id: 'recipeFormFields.templateVarHint', | ||
| defaultMessage: "Use '{{parameter_name}}' to define parameters that can be filled in when running the recipe.", |
There was a problem hiding this comment.
Escape literal template braces in ICU messages
react-intl treats {...} as ICU arguments, so defaultMessage: "Use '{{parameter_name}}' ..." is parsed as requiring a parameter_name value instead of rendering literal {{parameter_name}}. Both helper strings in this file are formatted without that value, which causes message-format errors/fallback behavior when the recipe form renders and the instructional text is displayed incorrectly. Use ICU escaping for literal braces (or inject the token as a value) so these hints render reliably.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The single quotes make an ICU MessageFormat literal; the braces inside single quotes are not interpreted. This is a false positive
c71d221 to
b1ce751
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1ce751437
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
67bba48 to
e0c5771
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0c5771262
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
1c5abd4 to
8277a8b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8277a8b10f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| "test:integration:debug": "DEBUG=1 vitest run --config vitest.integration.config.ts", | ||
| "start-alpha-gui": "ALPHA=true pnpm run start-gui" | ||
| "start-alpha-gui": "ALPHA=true pnpm run start-gui", | ||
| "i18n:extract": "formatjs extract 'src/**/*.{ts,tsx}' --out-file src/i18n/messages/en.json --flatten && pnpm run i18n:compile", |
There was a problem hiding this comment.
Make i18n extract command work in Windows npm shells
The i18n:extract script wraps the glob in single quotes, which cmd.exe (the default shell used by pnpm run on Windows) passes through literally instead of treating as quoting, so formatjs receives 'src/**/*.{ts,tsx}' and fails to match source files correctly. This breaks catalog regeneration for Windows contributors and can leave en.json stale or empty after running the documented extraction command.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is a false positive. We intend to pass the literal globs to formatjs, and it interprets them itself.
8277a8b to
fd0cf85
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fd0cf85132
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
fd0cf85 to
8a349e4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a349e4382
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
17d391f to
316b8ed
Compare
29e28df to
62e0ddf
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 62e0ddf0c7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
ce1695c to
5863dc2
Compare
62177ad to
bf1d9ff
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf1d9ff429
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
bf1d9ff to
1941fe8
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1941fe8b71
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Introduce internationalization foundation for the desktop UI using react-intl (FormatJS) with ICU MessageFormat support. Convert a representative set of components to demonstrate the pattern.
Replace hard-coded English strings with intl.formatMessage() calls across all desktop UI components. Regenerate en.json catalog.
1e2abcd to
4b7dd51
Compare
* origin/main: (63 commits) remove name from blog post (#8157) fix: use `overflow: clip` to not disrupt sticky ToC (#8158) chore(deps): bump path-to-regexp from 0.1.12 to 0.1.13 in /documentation (#8161) chore(deps): bump node-forge from 1.3.2 to 1.4.0 in /documentation (#8145) refactor: goose-acp-server -> goose binary for TUI (#8155) fix "View as Markdown" feature not working (#8160) feat(tui): UI improvements for messages, tool calls, text entry, etc (#8156) feat(desktop): add i18n infrastructure with react-intl (#8105) fix(tui): ordering of messages (#8144) fix: extension command with quotes in cli (#8150) chore(aaif): Use Azure Artifact Signing for Windows (#8116) chore(aaif): Switch macOS code signing (#8076) Remove unused tool call json in logs (#8147) feat(tui): tab expand tool calls cleanly (#8136) fix: replace panics with user-friendly errors in CLI session builder (#7901) fix: read GOOSE_CONTEXT_LIMIT from config.yaml, not just env vars (#7900) fix: deliver truncation notice as separate content block (#7899) fix: use platform-appropriate commands in developer extension instructions (#7898) fix: replace any with proper SVG types in icon components (#7873) chore: remove debug console.log statements, stale comments, and dead code (#8142) ...
Signed-off-by: Cameron Yick <[email protected]>
How to review
The first commit contains the i18n infrastructure, and migration of a few components to demonstrate how the infrastructure works.
The second commit is the rote migration of all strings in the app over to the i18n infrastructure, and probably doesn't need line-by-line review.
Summary
Adds internationalization infrastructure to the desktop UI using react-intl (FormatJS), with full ICU MessageFormat support for pluralization, select, and date/number formatting.
What's included:
IntlProviderwired at the app root with locale detection (GOOSE_LOCALE>navigator.language>en)defineMessages/useIntl()pattern applied to a representative set of components (LauncherView, SearchBar, AppSettingsSection, SessionListView)timeUtils.tspnpm i18n:extractto auto-generate the English catalog from source, andpnpm i18n:check(wired intolint:check) to enforce it stays in syncIntlTestWrappertest utility for components usinguseIntl()I18N.mdWhat's intentionally NOT included:
Testing
pnpm test:run— all 334 tests passpnpm lint:check— typecheck, eslint, and i18n catalog check all passpnpm i18n:checkverified to fail when catalog is stale, pass when in syncRelated Issues
Relates to #2376
Discussion: #7380