Skip to content

feat(desktop): add zh-CN localization support#7701

Closed
sysusugan wants to merge 1 commit intoaaif-goose:mainfrom
sysusugan:pr/desktop-zh-cn-localization-clean
Closed

feat(desktop): add zh-CN localization support#7701
sysusugan wants to merge 1 commit intoaaif-goose:mainfrom
sysusugan:pr/desktop-zh-cn-localization-clean

Conversation

@sysusugan
Copy link
Copy Markdown

@sysusugan sysusugan commented Mar 6, 2026

Motivation

This change aims to make Goose easier to adopt among Chinese-speaking developers by reducing the UI language barrier, while keeping English as the default experience.

Summary

  • add zh-CN as a desktop UI language while keeping English as the default
  • persist the selected UI language and sync language changes across windows
  • localize desktop navigation, settings, native menus, tray menus, dialogs, and major UI surfaces
  • add localization-aware tests and update existing UI tests for the new provider requirement

Scope

  • desktop only (ui/desktop)
  • no Rust core changes
  • no server API changes
  • no OpenAPI/schema changes

Implementation Notes

  • introduce a typed desktop i18n layer with en and zh-CN locale dictionaries
  • add a global LocalizationProvider and wire language selection into persisted desktop settings
  • rebuild native menus and tray UI from the current language instead of relying on hard-coded English labels
  • keep proper nouns in English where appropriate, including provider/model names, HuggingFace, OAuth, API Key, and extension names/descriptions

Validation

  • cd ui/desktop && npm run typecheck
  • cd ui/desktop && npm run test:run

Notes

  • extension names and extension card descriptions intentionally remain in English
  • language selection persists across restarts
  • language changes propagate across desktop windows

Screenshots

Examples of the zh-CN desktop experience, including settings, navigation, chat surfaces, and native desktop menus/tray UI.

image image image image

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: 728172b32d

ℹ️ 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".

Comment thread ui/desktop/src/main.ts
@sysusugan sysusugan force-pushed the pr/desktop-zh-cn-localization-clean branch from 728172b to bbd8f26 Compare March 6, 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: bbd8f268f0

ℹ️ 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".

Comment thread ui/desktop/src/main.ts
@sysusugan sysusugan force-pushed the pr/desktop-zh-cn-localization-clean branch from bbd8f26 to 1d04eb1 Compare March 6, 2026 18:19
@sysusugan
Copy link
Copy Markdown
Author

I also noticed #7599 is open in the same area.

This PR is intentionally optimized for depth rather than breadth. Instead of starting with a broader localization framework, it focuses on delivering a polished zh-CN desktop experience for Chinese-speaking developers:

  • no new i18n runtime dependency
  • desktop-only scope, with English still remaining the default
  • coverage includes native desktop surfaces such as menus and tray UI
  • wording is tuned for Chinese UI conventions and developer terminology, not just direct string replacement
  • proper nouns such as provider/model names, HuggingFace, OAuth, API Key, and extension names/descriptions remain in English where that reads more naturally

The goal here is not just to add a small amount of Chinese text, but to make the Chinese desktop experience feel complete, natural, and genuinely usable for real adoption.

If maintainers would prefer a single direction, I’m happy to align, narrow this further, or rework it to fit the preferred approach.

@blackgirlbytes
Copy link
Copy Markdown
Collaborator

I like this, but I would like to double check with folks like @DOsinga

@sysusugan
Copy link
Copy Markdown
Author

I like this, but I would like to double check with folks like @DOsinga

Thanks! Happy to wait for input from @DOsinga and address any feedback that comes up.

@michaelneale
Copy link
Copy Markdown
Collaborator

very nice!

/goose can we have a deep review of how idiomatic these changes are pls

@joylibo
Copy link
Copy Markdown

joylibo commented Mar 9, 2026

I’m a Chinese user, and I’d really like to see Chinese localization support in Goose. I merged this PR locally and tried it for a bit, and the overall experience is great. Most of it feels natural and would be genuinely helpful for Chinese users.

The only small thing that stood out to me was translating “deeplink” as “深链”. I’d personally suggest keeping “deeplink” in English.

@sysusugan
Copy link
Copy Markdown
Author

I’m a Chinese user, and I’d really like to see Chinese localization support in Goose. I merged this PR locally and tried it for a bit, and the overall experience is great. Most of it feels natural and would be genuinely helpful for Chinese users.

The only small thing that stood out to me was translating “deeplink” as “深链”. I’d personally suggest keeping “deeplink” in English.

Thanks for trying this locally and for the thoughtful feedback. I agree that “深链” doesn’t feel quite right here. I’m thinking of changing it to “深度链接”, which reads more naturally to me while still preserving the technical meaning. If you have another wording in mind, I’d love to hear it.

@turnerkoo15
Copy link
Copy Markdown

This change is heading in the right direction. It would be especially helpful if reviewers could focus on: 1) backward compatibility, 2) edge cases and fallback behavior, and 3) whether the naming and abstraction can be tightened further. If anyone has seen real-world issues in this part of the stack before, concrete examples would be very valuable here and would help make the merge much safer. 🚀🚀🚀

@sysusugan sysusugan force-pushed the pr/desktop-zh-cn-localization-clean branch from 1d04eb1 to b3b39c2 Compare March 9, 2026 14:55
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: b3b39c2785

ℹ️ 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".

Comment thread ui/desktop/src/main.ts Outdated
@sysusugan sysusugan force-pushed the pr/desktop-zh-cn-localization-clean branch from b3b39c2 to 5d198cc Compare March 9, 2026 15:28
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: 5d198ccb1b

ℹ️ 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".

Comment thread ui/desktop/src/components/settings/PromptsSettingsSection.tsx Outdated
@sysusugan sysusugan force-pushed the pr/desktop-zh-cn-localization-clean branch from 5d198cc to fa64638 Compare March 9, 2026 15: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: fa64638c20

ℹ️ 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".


initSession();
}, [resourceUri, extensionName, workingDir, cachedHtml]);
}, [resourceUri, extensionName, workingDir, cachedHtml, t]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Prevent language changes from restarting standalone app sessions

This useEffect now depends on t, so any UI language update (including broadcasts from another window) reruns initSession() and calls startAgent/resumeAgent again even when a standalone app session is already running. That recreates the backend session and swaps sessionId, which can interrupt the active app view and churn agent processes unnecessarily. The session-init effect should be decoupled from translation function changes or guarded once a session exists.

Useful? React with 👍 / 👎.

});
}
}, [isOpen, sessionId, hasAnalyzed, form]);
}, [isOpen, sessionId, hasAnalyzed, form, t]);
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 Stop re-triggering recipe analysis on locale updates

Including t in this analysis effect dependency list means a language change while the modal is open and hasAnalyzed is still false will kick off a second createRecipe request and a second stage timer. Because the effect has no cleanup return, both async flows can run concurrently and race to overwrite the form fields, causing duplicate backend work and inconsistent prefilled recipe content.

Useful? React with 👍 / 👎.

@sysusugan sysusugan force-pushed the pr/desktop-zh-cn-localization-clean branch from fa64638 to 5448d53 Compare March 9, 2026 17:02
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: 5448d53a71

ℹ️ 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".

Comment thread ui/desktop/src/components/settings/app/UpdateSection.tsx Outdated
@sysusugan sysusugan force-pushed the pr/desktop-zh-cn-localization-clean branch from 5448d53 to 1b15e0f Compare March 10, 2026 02:37
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: 1b15e0f33f

ℹ️ 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".

Comment thread ui/desktop/src/components/schedule/ScheduleModal.tsx Outdated
@sysusugan sysusugan force-pushed the pr/desktop-zh-cn-localization-clean branch from 1b15e0f to c35ac8f Compare March 10, 2026 03:20
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: c35ac8f069

ℹ️ 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".

Comment thread ui/desktop/src/components/LocalModelSetup.tsx Outdated
@sysusugan sysusugan force-pushed the pr/desktop-zh-cn-localization-clean branch from c35ac8f to 2ba6b21 Compare March 10, 2026 04:45
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: 2ba6b219d5

ℹ️ 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".

Comment thread ui/desktop/src/components/sessions/SessionListView.tsx Outdated
@sysusugan sysusugan force-pushed the pr/desktop-zh-cn-localization-clean branch from 2ba6b21 to 268752f Compare March 10, 2026 06:39
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: 268752f3f1

ℹ️ 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".

Comment thread ui/desktop/src/components/settings/models/subcomponents/SwitchModelModal.tsx Outdated
@sysusugan sysusugan force-pushed the pr/desktop-zh-cn-localization-clean branch from 268752f to 8497b7a Compare March 10, 2026 07:04
@sysusugan
Copy link
Copy Markdown
Author

I did another full pass on the desktop changes and fixed the remaining locale-change regressions I could find.

At this point, the desktop localization work should be complete with respect to the issues surfaced in review, including menu/tray behavior, async reload paths, and modal/form state resets. I also re-ran the full desktop checks locally:

  • npm run typecheck
  • npm run lint:check
  • npm run test:run

Result:

  • 26 test files passed
  • 328 passed / 3 skipped

@jh-block jh-block assigned jh-block and unassigned alexhancock Mar 11, 2026
Signed-off-by: sysusugan <sugan@foxmail.com>
@DOsinga
Copy link
Copy Markdown
Collaborator

DOsinga commented Mar 26, 2026

Thanks for the effort here — adding zh-CN localization is a meaningful contribution and we appreciate the interest!

However, we're going to close this PR for a few reasons:

  1. First-time contributor with a very large PR (130 files, 7k+ lines). Our contributing guide asks first-time contributors to start with smaller changes so we can build familiarity with the codebase together: https://github.com/block/goose/blob/main/CONTRIBUTING.md#getting-started

  2. Large feature without a prior issue or discussion. A change of this scope needs alignment with maintainers before the work begins: https://github.com/block/goose/blob/main/CONTRIBUTING.md#discussions-issues-and-prs

  3. Unaddressed codex review comments. There are ~7 review comments about a systemic bug (adding t to useEffect dependency arrays, causing effects like session restarts and tray crashes on language switch) that were never addressed or responded to: https://github.com/block/goose/blob/main/CONTRIBUTING.md#ai-code-reviews

For what it's worth, we've gone in a different direction for i18n — see #8105. If you'd like to contribute zh-CN translations within that framework, that would be very welcome as a follow-up!

@DOsinga DOsinga closed this Mar 26, 2026
@sysusugan
Copy link
Copy Markdown
Author

Thanks for the clear feedback — that makes sense.

I understand this PR was too large for a first contribution, should have started with prior discussion, and didn’t land in the right shape for review.

I still care about zh-CN support for Goose, so I’ll keep following the progress around #8105 and see whether there’s a useful way for me to contribute later on.

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.

8 participants