Skip to content

feat(ui): add i18n scaffolding with zh-CN locale#7998

Open
kmzt-trade wants to merge 2 commits intoblock:mainfrom
kmzt-trade:feat/i18n-zh-cn
Open

feat(ui): add i18n scaffolding with zh-CN locale#7998
kmzt-trade wants to merge 2 commits intoblock:mainfrom
kmzt-trade:feat/i18n-zh-cn

Conversation

@kmzt-trade
Copy link

Summary

Testing

Related Issues

Relates to #ISSUE_ID
Discussion: LINK (if any)

Screenshots/Demos (for UX changes)

Before:

After:

Summary

  • add i18next + react-i18next setup for the desktop UI
  • initialize i18n on renderer startup and add locale resources
  • localize navigation, session list, setup modal, telemetry and privacy copy

Testing

  • pnpm install
  • pnpm lint:check
  • pnpm test:run

Copy link

@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: 10627a199d

ℹ️ 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 on lines 17 to +19
export const NAV_ITEMS: NavItem[] = [
{ id: 'home', path: '/', label: 'Home', icon: Home },
{ id: 'chat', path: '/pair', label: 'Chat', icon: MessageSquare, hasSubItems: true },
{ id: 'recipes', path: '/recipes', label: 'Recipes', icon: FileText },
{ id: 'apps', path: '/apps', label: 'Apps', icon: AppWindow },
{ id: 'scheduler', path: '/schedules', label: 'Scheduler', icon: Clock },
{ id: 'extensions', path: '/extensions', label: 'Extensions', icon: Puzzle },
{ id: 'settings', path: '/settings', label: 'Settings', icon: Settings },
{ id: 'home', path: '/', label: t('nav.home'), icon: Home },
{ id: 'chat', path: '/pair', label: t('nav.chat'), icon: MessageSquare, hasSubItems: true },

Choose a reason for hiding this comment

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

P1 Badge Build navigation labels after i18n initialization

src/i18n/index.ts initializes i18next with init(...), but NAV_ITEMS evaluates i18n.t(...) immediately at module import time. NavigationPanel then memoizes getNavItemById() results without any language dependency, so on a cold start in a non-English locale the sidebar can stay stuck with whatever t() returned before initialization completed (typically English or the raw key) for the lifetime of that renderer process.

Useful? React with 👍 / 👎.

Comment on lines +8 to +9
const lower = language.toLowerCase();
if (lower.startsWith('zh')) return 'zh-CN';

Choose a reason for hiding this comment

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

P2 Badge Stop mapping every Chinese locale to zh-CN

This normalizer forces zh-TW, zh-HK, and other non-Simplified Chinese locales onto the zh-CN resource even though the bundle only ships a Simplified Chinese translation. For users whose navigator.language is Traditional Chinese, that is a readability regression compared with falling back to English, because we are selecting the wrong writing system rather than an unsupported locale fallback.

Useful? React with 👍 / 👎.

Copy link

@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: 505da2b292

ℹ️ 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 on lines +239 to +243
const handleLanguageChange = (option: { value: LanguagePreference; label: string } | null) => {
const nextLanguage = option?.value ?? 'system';
setLanguagePreference(nextLanguage);
void window.electron.setSetting('language', nextLanguage);
applyLanguagePreference(nextLanguage);

Choose a reason for hiding this comment

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

P2 Badge Broadcast language changes to every open renderer

If a user has multiple Goose windows open (the app supports this via window.electron.createChatWindow(...) in App.tsx and related views), changing the language here only updates the current renderer. Unlike theme changes, there is no IPC broadcast/listener pair analogous to broadcastThemeChange/theme-changed in ThemeContext.tsx, so the other windows stay in the old locale until they are reopened. With the new app-wide language setting, that leaves multi-window sessions inconsistent.

Useful? React with 👍 / 👎.

@DOsinga DOsinga added the needs_human label to set when a robot looks at a PR and can't handle it label Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs_human label to set when a robot looks at a PR and can't handle it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants