Skip to content

feat(desktop): add i18n infrastructure with react-intl#8105

Merged
jh-block merged 2 commits intomainfrom
jhugo/desktop-i18n
Mar 27, 2026
Merged

feat(desktop): add i18n infrastructure with react-intl#8105
jh-block merged 2 commits intomainfrom
jhugo/desktop-i18n

Conversation

@jh-block
Copy link
Copy Markdown
Collaborator

@jh-block jh-block commented Mar 25, 2026

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:

  • IntlProvider wired 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)
  • Locale-aware date/time formatting in timeUtils.ts
  • pnpm i18n:extract to auto-generate the English catalog from source, and pnpm i18n:check (wired into lint:check) to enforce it stays in sync
  • Unit tests for locale detection and message loading
  • IntlTestWrapper test utility for components using useIntl()
  • Developer documentation in I18N.md
  • All components converted to use the i18n infrastructure

What's intentionally NOT included:

  • No non-English translations (infrastructure only)
  • No language selector UI

Testing

  • pnpm test:run — all 334 tests pass
  • pnpm lint:check — typecheck, eslint, and i18n catalog check all pass
  • pnpm i18n:check verified to fail when catalog is stale, pass when in sync

Related Issues

Relates to #2376
Discussion: #7380

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@jh-block jh-block force-pushed the jhugo/desktop-i18n branch from e2b6678 to d3bba30 Compare March 25, 2026 18:00
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The single quotes make an ICU MessageFormat literal; the braces inside single quotes are not interpreted. This is a false positive

@jh-block jh-block force-pushed the jhugo/desktop-i18n branch from c71d221 to b1ce751 Compare March 25, 2026 19:49
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@jh-block jh-block force-pushed the jhugo/desktop-i18n branch from 67bba48 to e0c5771 Compare March 25, 2026 20:09
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@jh-block jh-block force-pushed the jhugo/desktop-i18n branch from 1c5abd4 to 8277a8b Compare March 25, 2026 20:27
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a false positive. We intend to pass the literal globs to formatjs, and it interprets them itself.

@jh-block jh-block force-pushed the jhugo/desktop-i18n branch from 8277a8b to fd0cf85 Compare March 26, 2026 08:43
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@jh-block jh-block force-pushed the jhugo/desktop-i18n branch from fd0cf85 to 8a349e4 Compare March 26, 2026 09:11
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@jh-block jh-block force-pushed the jhugo/desktop-i18n branch 2 times, most recently from 17d391f to 316b8ed Compare March 26, 2026 09:31
@jh-block jh-block force-pushed the jhugo/desktop-i18n branch 2 times, most recently from 29e28df to 62e0ddf Compare March 26, 2026 19:10
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@jh-block jh-block force-pushed the jhugo/desktop-i18n branch from ce1695c to 5863dc2 Compare March 26, 2026 19:29
@jh-block jh-block force-pushed the jhugo/desktop-i18n branch 2 times, most recently from 62177ad to bf1d9ff Compare March 27, 2026 11:09
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@jh-block jh-block force-pushed the jhugo/desktop-i18n branch from bf1d9ff to 1941fe8 Compare March 27, 2026 11:29
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.
@jh-block jh-block force-pushed the jhugo/desktop-i18n branch from 1e2abcd to 4b7dd51 Compare March 27, 2026 12:57
@jh-block jh-block added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit a6765fb Mar 27, 2026
23 checks passed
@jh-block jh-block deleted the jhugo/desktop-i18n branch March 27, 2026 18:53
michaelneale added a commit that referenced this pull request Mar 30, 2026
* 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)
  ...
hydrosquall pushed a commit to hydrosquall/goose that referenced this pull request Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants