Skip to content

Conversation

@g1331
Copy link
Contributor

@g1331 g1331 commented Jan 16, 2026

Base Branch

  • This PR targets the develop branch (required for all feature/fix PRs)
  • This PR targets main (hotfix only - maintainers)

Description

Adds Simplified Chinese (zh-CN) i18n resources for the frontend and registers the new locale in the i18n resource map and language selector.

Related Issue

Closes #

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Test

Area

  • Frontend
  • Backend
  • Fullstack

Commit Message Format

Follow conventional commits: :

Types: feat, fix, docs, style, refactor, test, chore

Example: feat: add user authentication system

Checklist

  • I've synced with develop branch
  • I've tested my changes locally
  • I've followed the code principles (SOLID, DRY, KISS)
  • My PR is small and focused (< 400 lines ideally)

Platform Testing Checklist

CRITICAL: This project supports Windows, macOS, and Linux. Platform-specific bugs are a common source of breakage.

  • Windows tested (either on Windows or via CI)
  • macOS tested (either on macOS or via CI)
  • Linux tested (CI covers this)
  • Used centralized platform/ module instead of direct process.platform checks
  • No hardcoded paths (used findExecutable() or platform abstractions)

If you only have access to one OS: CI now tests on all platforms. Ensure all checks pass before submitting.

CI/Testing Requirements

  • All CI checks pass on all platforms (Windows, macOS, Linux)
  • All existing tests pass
  • New features include test coverage
  • Bug fixes include regression tests

Screenshots

Before After
N/A (translation-only) N/A (translation-only)

Feature Toggle

  • Behind localStorage flag: use_feature_name
  • Behind settings toggle
  • Behind environment variable/config
  • N/A - Feature is complete and ready for all users

Breaking Changes

Breaking: No

Details:
N/A

Summary by CodeRabbit

  • New Features

    • Added Simplified Chinese (zh-CN) localization across the app: settings, navigation, tasks, dialogs, onboarding, welcome, GitLab integration, code review, terminal, errors, and more.
    • Language selection updated to include Chinese (Simplified); default language remains English.
  • Bug Fixes / Migrations

    • Legacy language codes (e.g., "zh") are automatically migrated to the new zh-CN code during settings load.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 16, 2026

Caution

Review failed

The head commit changed during the review from c021abd to 73bfd85.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds Simplified Chinese (zh-CN) support: expands SupportedLanguage and AVAILABLE_LANGUAGES, registers zh-CN resources in the i18n registry, adds comprehensive zh-CN locale JSONs, and updates settings migration to convert legacy 'zh' → 'zh-CN' and persist migrated fields.

Changes

Cohort / File(s) Summary
Language type & constants
apps/frontend/src/shared/constants/i18n.ts
Extended SupportedLanguage to include 'zh-CN' and added Chinese entry to AVAILABLE_LANGUAGES.
i18n resources registry
apps/frontend/src/shared/i18n/index.ts
Imported zh-CN locale modules and added a top-level 'zh-CN' namespace to the resources object.
Settings migration & persistence
apps/frontend/src/renderer/stores/settings-store.ts
Added migrateLanguageCode to convert legacy 'zh''zh-CN'; applied it in loadSettings alongside onboarding migration and coalesced saves when changes occur.
Chinese locale files (new)
apps/frontend/src/shared/i18n/locales/zh-CN/*
common.json, navigation.json, settings.json, tasks.json, welcome.json, onboarding.json, dialogs.json, gitlab.json, taskReview.json, terminal.json, errors.json
Added comprehensive Simplified Chinese translations across UI namespaces (multiple new JSON files totaling several hundred lines).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • AndyMik90/Auto-Claude#634 — Adds zh-CN translations and registers 'zh-CN' in i18n (directly related to this PR's language additions).
  • AndyMik90/Auto-Claude#248 — Introduced or extended i18n infrastructure and en/fr resources that this PR builds upon.
  • AndyMik90/Auto-Claude#386 — Touches the same i18n registry/resources (apps/frontend/src/shared/i18n/index.ts) and complements these locale additions.

Suggested labels

area/frontend, size/XL, 🔄 Checking

Suggested reviewers

  • AndyMik90
  • AlexMadera

Poem

🐰 I hopped from keys to strings today,
Added 简体中文 to the display,
Migrated old codes with a twitch,
Now zh-CN joins the language switch,
Hooray — translations brighten the way 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(i18n): add zh-CN locale' is concise, specific, and clearly summarizes the main change—adding Chinese (Simplified) localization support. It directly reflects the primary objective of the PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @g1331, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the frontend application's internationalization capabilities by introducing full support for Simplified Chinese (zh-CN). It expands the range of available language options for users and integrates extensive translation files to ensure a localized experience across the user interface, improving accessibility for Chinese-speaking users.

Highlights

  • New Language Support: Simplified Chinese (zh-CN) has been added as a new supported language for the frontend application.
  • Internationalization Resource Integration: Comprehensive translation resources for Simplified Chinese have been integrated across various frontend components, including common terms, dialogs, error messages, navigation, settings, and task management.
  • Language Selector Update: The application's language selector and internal i18n configuration have been updated to recognize and utilize the newly added Chinese translations.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for Simplified Chinese (zh-CN) to the application. The changes include updating the language configuration, adding the new locale to the i18n resources, and providing the translation files.

The implementation is mostly correct, but I have a few suggestions for improvement:

  1. Language Code Consistency: The PR title and description use zh-CN, but the code and file structure use zh. It would be better to consistently use the more specific zh-CN tag, which aligns with BCP 47 standards. I've left comments with suggestions on how to apply this change.
  2. Redundant Pluralization Keys: The Chinese translation files contain several keys for pluralization (e.g., key_plural, key_other) that have the same value as their singular counterparts. Since Chinese doesn't have grammatical plurals in the same way as English, these keys are redundant and can be removed to simplify the translation files. I've pointed out a few examples.

Overall, this is a great addition. Addressing these points will improve the consistency and maintainability of the internationalization setup.

Comment on lines 6 to 12
export type SupportedLanguage = 'en' | 'fr' | 'zh';

export const AVAILABLE_LANGUAGES = [
{ value: 'en' as const, label: 'English', nativeLabel: 'English' },
{ value: 'fr' as const, label: 'French', nativeLabel: 'Français' }
{ value: 'fr' as const, label: 'French', nativeLabel: 'Français' },
{ value: 'zh' as const, label: 'Chinese (Simplified)', nativeLabel: '简体中文' }
] as const;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For consistency with the PR title (feat(i18n): add zh-CN locale) and to follow the BCP 47 standard for language tags, it's better to use the more specific zh-CN for Simplified Chinese instead of the generic zh. This improves clarity and maintainability. This change should be applied consistently across all related files (i18n resource registration, folder names, etc.).

Suggested change
export type SupportedLanguage = 'en' | 'fr' | 'zh';
export const AVAILABLE_LANGUAGES = [
{ value: 'en' as const, label: 'English', nativeLabel: 'English' },
{ value: 'fr' as const, label: 'French', nativeLabel: 'Français' }
{ value: 'fr' as const, label: 'French', nativeLabel: 'Français' },
{ value: 'zh' as const, label: 'Chinese (Simplified)', nativeLabel: '简体中文' }
] as const;
export type SupportedLanguage = 'en' | 'fr' | 'zh-CN';
export const AVAILABLE_LANGUAGES = [
{ value: 'en' as const, label: 'English', nativeLabel: 'English' },
{ value: 'fr' as const, label: 'French', nativeLabel: 'Français' },
{ value: 'zh-CN' as const, label: 'Chinese (Simplified)', nativeLabel: '简体中文' }
] as const;

Comment on lines 30 to 41
// Import Chinese translation resources
import zhCommon from './locales/zh/common.json';
import zhNavigation from './locales/zh/navigation.json';
import zhSettings from './locales/zh/settings.json';
import zhTasks from './locales/zh/tasks.json';
import zhWelcome from './locales/zh/welcome.json';
import zhOnboarding from './locales/zh/onboarding.json';
import zhDialogs from './locales/zh/dialogs.json';
import zhGitlab from './locales/zh/gitlab.json';
import zhTaskReview from './locales/zh/taskReview.json';
import zhTerminal from './locales/zh/terminal.json';
import zhErrors from './locales/zh/errors.json';
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To align with the suggested change from zh to zh-CN, these import paths should be updated. This also implies that the locale directory zh should be renamed to zh-CN.

Suggested change
// Import Chinese translation resources
import zhCommon from './locales/zh/common.json';
import zhNavigation from './locales/zh/navigation.json';
import zhSettings from './locales/zh/settings.json';
import zhTasks from './locales/zh/tasks.json';
import zhWelcome from './locales/zh/welcome.json';
import zhOnboarding from './locales/zh/onboarding.json';
import zhDialogs from './locales/zh/dialogs.json';
import zhGitlab from './locales/zh/gitlab.json';
import zhTaskReview from './locales/zh/taskReview.json';
import zhTerminal from './locales/zh/terminal.json';
import zhErrors from './locales/zh/errors.json';
// Import Chinese translation resources
import zhCommon from './locales/zh-CN/common.json';
import zhNavigation from './locales/zh-CN/navigation.json';
import zhSettings from './locales/zh-CN/settings.json';
import zhTasks from './locales/zh-CN/tasks.json';
import zhWelcome from './locales/zh-CN/welcome.json';
import zhOnboarding from './locales/zh-CN/onboarding.json';
import zhDialogs from './locales/zh-CN/dialogs.json';
import zhGitlab from './locales/zh-CN/gitlab.json';
import zhTaskReview from './locales/zh-CN/taskReview.json';
import zhTerminal from './locales/zh-CN/terminal.json';
import zhErrors from './locales/zh-CN/errors.json';

Comment on lines 72 to 84
zh: {
common: zhCommon,
navigation: zhNavigation,
settings: zhSettings,
tasks: zhTasks,
welcome: zhWelcome,
onboarding: zhOnboarding,
dialogs: zhDialogs,
gitlab: zhGitlab,
taskReview: zhTaskReview,
terminal: zhTerminal,
errors: zhErrors
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To align with the suggested change from zh to zh-CN, the resource key should be updated to 'zh-CN'.

Suggested change
zh: {
common: zhCommon,
navigation: zhNavigation,
settings: zhSettings,
tasks: zhTasks,
welcome: zhWelcome,
onboarding: zhOnboarding,
dialogs: zhDialogs,
gitlab: zhGitlab,
taskReview: zhTaskReview,
terminal: zhTerminal,
errors: zhErrors
}
'zh-CN': {
common: zhCommon,
navigation: zhNavigation,
settings: zhSettings,
tasks: zhTasks,
welcome: zhWelcome,
onboarding: zhOnboarding,
dialogs: zhDialogs,
gitlab: zhGitlab,
taskReview: zhTaskReview,
terminal: zhTerminal,
errors: zhErrors
}

@sentry
Copy link

sentry bot commented Jan 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@apps/frontend/src/renderer/stores/settings-store.ts`:
- Around line 348-362: When persisting migrated settings, don't let save
failures abort the rest of the load flow: wrap the await
window.electronAPI.saveSettings(updates) call in its own try/catch, log the
error (e.g., console.error or an existing logger), and continue so that
store.setSettings(...) and markSettingsLoaded() still run; locate this around
migrateLanguageCode/migrateOnboardingCompleted, where updates is built, and
ensure the catch only handles/logs the persistence error without rethrowing.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dfa35e4 and 634a0c4.

📒 Files selected for processing (14)
  • apps/frontend/src/renderer/stores/settings-store.ts
  • apps/frontend/src/shared/constants/i18n.ts
  • apps/frontend/src/shared/i18n/index.ts
  • apps/frontend/src/shared/i18n/locales/zh-CN/common.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/dialogs.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/errors.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/gitlab.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/navigation.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/onboarding.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/settings.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/taskReview.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/tasks.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/terminal.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/welcome.json
🧰 Additional context used
📓 Path-based instructions (5)
apps/frontend/src/shared/i18n/locales/**/*.json

📄 CodeRabbit inference engine (CLAUDE.md)

Translation file locations use namespaces: common.json, navigation.json, settings.json, dialogs.json, tasks.json, errors.json, onboarding.json, welcome.json in apps/frontend/src/shared/i18n/locales/{language}/

Files:

  • apps/frontend/src/shared/i18n/locales/zh-CN/terminal.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/taskReview.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/gitlab.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/onboarding.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/navigation.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/settings.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/dialogs.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/errors.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/tasks.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/welcome.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/common.json
apps/frontend/src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (CLAUDE.md)

apps/frontend/src/**/*.{tsx,ts}: All user-facing text in the frontend MUST use i18n translation keys from react-i18next, not hardcoded strings
Use translation key format namespace:section.key (e.g., navigation:items.githubPRs) when referencing translations in code
For error messages with dynamic content, use i18n interpolation with syntax like t('errors:task.parseError', { error: errorMessage })

Files:

  • apps/frontend/src/shared/constants/i18n.ts
  • apps/frontend/src/renderer/stores/settings-store.ts
  • apps/frontend/src/shared/i18n/index.ts
**/*.{ts,tsx,js,py}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx,js,py}: Do not check process.platform directly in code - always import platform detection functions from the platform abstraction module
Never hardcode platform-specific paths like C:\Program Files\, /opt/homebrew/bin/, or /usr/local/bin/ directly in code

Files:

  • apps/frontend/src/shared/constants/i18n.ts
  • apps/frontend/src/renderer/stores/settings-store.ts
  • apps/frontend/src/shared/i18n/index.ts
apps/frontend/**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (CLAUDE.md)

Frontend code must be built with Electron, React, and TypeScript

Files:

  • apps/frontend/src/shared/constants/i18n.ts
  • apps/frontend/src/renderer/stores/settings-store.ts
  • apps/frontend/src/shared/i18n/index.ts
apps/frontend/**/*.{ts,tsx}

⚙️ CodeRabbit configuration file

apps/frontend/**/*.{ts,tsx}: Review React patterns and TypeScript type safety.
Check for proper state management and component composition.

Files:

  • apps/frontend/src/shared/constants/i18n.ts
  • apps/frontend/src/renderer/stores/settings-store.ts
  • apps/frontend/src/shared/i18n/index.ts
🧠 Learnings (8)
📓 Common learnings
Learnt from: MikeeBuilds
Repo: AndyMik90/Auto-Claude PR: 661
File: apps/frontend/src/renderer/components/onboarding/OllamaModelSelector.tsx:176-189
Timestamp: 2026-01-04T23:59:48.743Z
Learning: In the AndyMik90/Auto-Claude repository, pre-existing i18n issues (hardcoded user-facing strings that should be localized) can be deferred to future i18n cleanup passes rather than requiring immediate fixes in PRs that don't introduce new i18n violations.
Learnt from: taniar88
Repo: AndyMik90/Auto-Claude PR: 883
File: apps/frontend/src/main/agent/agent-process.ts:21-21
Timestamp: 2026-01-10T15:30:25.649Z
Learning: In the AndyMik90/Auto-Claude repository, new languages should only be added to AVAILABLE_LANGUAGES constant in apps/frontend/src/shared/constants/i18n.ts once their UI translations are complete in apps/frontend/src/shared/i18n/locales/. This avoids implying official support for incomplete translations and prevents user-facing issues.
Learnt from: CR
Repo: AndyMik90/Auto-Claude PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-16T09:10:31.701Z
Learning: Applies to apps/frontend/src/shared/i18n/locales/**/*.json : Translation file locations use namespaces: `common.json`, `navigation.json`, `settings.json`, `dialogs.json`, `tasks.json`, `errors.json`, `onboarding.json`, `welcome.json` in `apps/frontend/src/shared/i18n/locales/{language}/`
Learnt from: CR
Repo: AndyMik90/Auto-Claude PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-16T09:10:31.701Z
Learning: Applies to apps/frontend/src/**/*.{tsx,ts} : Use translation key format `namespace:section.key` (e.g., `navigation:items.githubPRs`) when referencing translations in code
📚 Learning: 2026-01-16T09:10:31.701Z
Learnt from: CR
Repo: AndyMik90/Auto-Claude PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-16T09:10:31.701Z
Learning: Applies to apps/frontend/src/shared/i18n/locales/**/*.json : Translation file locations use namespaces: `common.json`, `navigation.json`, `settings.json`, `dialogs.json`, `tasks.json`, `errors.json`, `onboarding.json`, `welcome.json` in `apps/frontend/src/shared/i18n/locales/{language}/`

Applied to files:

  • apps/frontend/src/shared/i18n/locales/zh-CN/terminal.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/taskReview.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/gitlab.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/onboarding.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/navigation.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/settings.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/dialogs.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/errors.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/tasks.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/welcome.json
  • apps/frontend/src/shared/constants/i18n.ts
  • apps/frontend/src/shared/i18n/locales/zh-CN/common.json
  • apps/frontend/src/shared/i18n/index.ts
📚 Learning: 2026-01-10T15:30:12.808Z
Learnt from: taniar88
Repo: AndyMik90/Auto-Claude PR: 883
File: apps/frontend/src/main/agent/agent-process.ts:21-21
Timestamp: 2026-01-10T15:30:12.808Z
Learning: Before adding a new language to AVAILABLE_LANGUAGES, ensure UI translations exist and are complete in apps/frontend/src/shared/i18n/locales. Do not advertise official support for a language until its locale files are fully translated and validated, to avoid user-facing issues.

Applied to files:

  • apps/frontend/src/shared/i18n/locales/zh-CN/terminal.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/taskReview.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/gitlab.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/onboarding.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/navigation.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/settings.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/dialogs.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/errors.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/tasks.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/welcome.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/common.json
  • apps/frontend/src/shared/i18n/index.ts
📚 Learning: 2026-01-16T09:10:31.701Z
Learnt from: CR
Repo: AndyMik90/Auto-Claude PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-16T09:10:31.701Z
Learning: Applies to apps/frontend/src/**/*.{tsx,ts} : Use translation key format `namespace:section.key` (e.g., `navigation:items.githubPRs`) when referencing translations in code

Applied to files:

  • apps/frontend/src/shared/i18n/locales/zh-CN/navigation.json
  • apps/frontend/src/shared/i18n/locales/zh-CN/common.json
  • apps/frontend/src/shared/i18n/index.ts
📚 Learning: 2026-01-16T09:10:31.701Z
Learnt from: CR
Repo: AndyMik90/Auto-Claude PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-16T09:10:31.701Z
Learning: Applies to apps/frontend/src/**/*.{tsx,ts} : For error messages with dynamic content, use i18n interpolation with syntax like `t('errors:task.parseError', { error: errorMessage })`

Applied to files:

  • apps/frontend/src/shared/i18n/locales/zh-CN/errors.json
  • apps/frontend/src/shared/i18n/index.ts
📚 Learning: 2026-01-10T15:30:25.649Z
Learnt from: taniar88
Repo: AndyMik90/Auto-Claude PR: 883
File: apps/frontend/src/main/agent/agent-process.ts:21-21
Timestamp: 2026-01-10T15:30:25.649Z
Learning: In the AndyMik90/Auto-Claude repository, new languages should only be added to AVAILABLE_LANGUAGES constant in apps/frontend/src/shared/constants/i18n.ts once their UI translations are complete in apps/frontend/src/shared/i18n/locales/. This avoids implying official support for incomplete translations and prevents user-facing issues.

Applied to files:

  • apps/frontend/src/shared/constants/i18n.ts
📚 Learning: 2026-01-16T09:10:31.701Z
Learnt from: CR
Repo: AndyMik90/Auto-Claude PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-16T09:10:31.701Z
Learning: Applies to apps/frontend/src/**/*.{tsx,ts} : All user-facing text in the frontend MUST use i18n translation keys from `react-i18next`, not hardcoded strings

Applied to files:

  • apps/frontend/src/shared/constants/i18n.ts
  • apps/frontend/src/shared/i18n/locales/zh-CN/common.json
  • apps/frontend/src/shared/i18n/index.ts
📚 Learning: 2026-01-04T23:59:48.743Z
Learnt from: MikeeBuilds
Repo: AndyMik90/Auto-Claude PR: 661
File: apps/frontend/src/renderer/components/onboarding/OllamaModelSelector.tsx:176-189
Timestamp: 2026-01-04T23:59:48.743Z
Learning: In the AndyMik90/Auto-Claude repository, pre-existing i18n issues (hardcoded user-facing strings that should be localized) can be deferred to future i18n cleanup passes rather than requiring immediate fixes in PRs that don't introduce new i18n violations.

Applied to files:

  • apps/frontend/src/shared/i18n/locales/zh-CN/common.json
🧬 Code graph analysis (1)
apps/frontend/src/renderer/stores/settings-store.ts (1)
apps/frontend/src/shared/types/settings.ts (1)
  • AppSettings (219-286)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: test-python (3.13, windows-latest)
  • GitHub Check: test-python (3.12, macos-latest)
  • GitHub Check: test-python (3.12, windows-latest)
  • GitHub Check: test-frontend (windows-latest)
  • GitHub Check: test-frontend (macos-latest)
  • GitHub Check: CodeQL (python)
  • GitHub Check: CodeQL (javascript-typescript)
🔇 Additional comments (18)
apps/frontend/src/shared/i18n/locales/zh-CN/welcome.json (1)

1-16: LGTM — welcome strings and placeholders look consistent.

apps/frontend/src/shared/i18n/locales/zh-CN/navigation.json (1)

1-80: LGTM — navigation resource is structurally aligned with expected keys.

apps/frontend/src/shared/i18n/locales/zh-CN/onboarding.json (1)

1-237: LGTM — onboarding translations appear comprehensive and preserve placeholders.

apps/frontend/src/shared/i18n/locales/zh-CN/tasks.json (1)

1-244: LGTM — task translations are thorough and keep interpolation placeholders intact.

apps/frontend/src/shared/constants/i18n.ts (1)

6-12: zh-CN locale is complete — the addition to AVAILABLE_LANGUAGES is valid.

All required translation namespaces (common, navigation, settings, dialogs, tasks, errors, onboarding, welcome) are present in the zh-CN directory with matching key counts to the English locale. The language is ready to be advertised.

apps/frontend/src/shared/i18n/locales/zh-CN/errors.json (1)

1-5: LGTM — translation and placeholders look consistent.

apps/frontend/src/renderer/stores/settings-store.ts (1)

298-308: LGTM — legacy zh mapping is clear and contained.

apps/frontend/src/shared/i18n/locales/zh-CN/dialogs.json (1)

1-163: LGTM — dialogs namespace looks complete.

apps/frontend/src/shared/i18n/locales/zh-CN/taskReview.json (1)

1-58: LGTM — task review translations look good.

apps/frontend/src/shared/i18n/locales/zh-CN/gitlab.json (1)

1-208: No action needed. The gitlab namespace is properly registered in apps/frontend/src/shared/i18n/index.ts with full locale coverage (en, fr, zh-CN) and correctly included in the i18n configuration. The coding guidelines documentation is outdated and does not reflect the complete list of active namespaces in the codebase, which includes gitlab, taskReview, and terminal in addition to the originally documented ones.

apps/frontend/src/shared/i18n/locales/zh-CN/terminal.json (1)

1-39: LGTM!

The terminal translations are well-structured with proper Chinese localization. Interpolation placeholders ({{profileName}}, {{branch}}) are correctly formatted and consistent with i18next conventions.

apps/frontend/src/shared/i18n/locales/zh-CN/common.json (3)

257-266: Verify duplicate severity labels are intentional.

Both medium and low severity levels translate to "建议" (suggestion). While this may be intentional (grouping non-critical items), it could cause confusion in the UI where users need to distinguish between the two levels.

Consider using distinct translations:

  • medium: "建议" (suggestion)
  • low: "可选" (optional) or "参考" (reference)

320-322: Mixed language in PR review messages.

These strings contain both English ("Auto Claude PR Review") and Chinese. This appears intentional for brand consistency, but verify this matches the pattern used in other locales (en, fr) and aligns with UX expectations for Chinese users.


1-371: Translations are comprehensive and well-structured.

The common.json file provides thorough coverage of UI elements with proper interpolation syntax and nested organization. ARIA labels and accessibility strings are included, which is excellent for i18n completeness.

apps/frontend/src/shared/i18n/index.ts (2)

30-42: LGTM!

The zh-CN imports follow the established naming convention (zhCn prefix) and correctly reference the zh-CN directory path, addressing the previous review feedback about directory naming.


71-84: LGTM!

The zh-CN resource entry is correctly structured with all 11 namespaces matching the English and French locale configurations. The BCP 47 language tag 'zh-CN' is appropriate for Simplified Chinese.

apps/frontend/src/shared/i18n/locales/zh-CN/settings.json (2)

265-269: Security warning translation looks good.

The YOLO mode warning appropriately conveys the security implications in Chinese. The --dangerously-skip-permissions flag is kept in English (correct, as it's a CLI argument).


1-581: Comprehensive settings translations.

The settings.json file provides thorough coverage of all settings sections with:

  • Proper interpolation syntax throughout
  • Appropriate preservation of technical terms (OAuth, API Key, MCP, Git, etc.)
  • Consistent nested structure matching the application's settings hierarchy
  • Complete validation messages and toast notifications

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +348 to 362
// Apply migrations
const migratedSettings = migrateLanguageCode(migrateOnboardingCompleted(result.data));
store.setSettings(migratedSettings);

// If migration changed the settings, persist them
// If migrations changed the settings, persist them
const updates: Partial<AppSettings> = {};
if (migratedSettings.onboardingCompleted !== result.data.onboardingCompleted) {
await window.electronAPI.saveSettings({
onboardingCompleted: migratedSettings.onboardingCompleted
});
updates.onboardingCompleted = migratedSettings.onboardingCompleted;
}
if (migratedSettings.language !== result.data.language) {
updates.language = migratedSettings.language;
}
if (Object.keys(updates).length > 0) {
await window.electronAPI.saveSettings(updates);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Don’t abort settings load if migration persistence fails.

A failed saveSettings here will throw into the outer catch, preventing markSettingsLoaded() even though settings were successfully retrieved. That can leave Sentry (and any “settings loaded” gate) disabled due to a transient persistence error. Consider isolating persistence failures and logging them instead.

🛠️ Suggested fix
-      if (Object.keys(updates).length > 0) {
-        await window.electronAPI.saveSettings(updates);
-      }
+      if (Object.keys(updates).length > 0) {
+        try {
+          const saveResult = await window.electronAPI.saveSettings(updates);
+          if (!saveResult.success) {
+            console.warn('[settings-store] Failed to persist migrated settings', saveResult.error);
+          }
+        } catch (error) {
+          console.warn('[settings-store] Failed to persist migrated settings', error);
+        }
+      }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Apply migrations
const migratedSettings = migrateLanguageCode(migrateOnboardingCompleted(result.data));
store.setSettings(migratedSettings);
// If migration changed the settings, persist them
// If migrations changed the settings, persist them
const updates: Partial<AppSettings> = {};
if (migratedSettings.onboardingCompleted !== result.data.onboardingCompleted) {
await window.electronAPI.saveSettings({
onboardingCompleted: migratedSettings.onboardingCompleted
});
updates.onboardingCompleted = migratedSettings.onboardingCompleted;
}
if (migratedSettings.language !== result.data.language) {
updates.language = migratedSettings.language;
}
if (Object.keys(updates).length > 0) {
await window.electronAPI.saveSettings(updates);
}
// Apply migrations
const migratedSettings = migrateLanguageCode(migrateOnboardingCompleted(result.data));
store.setSettings(migratedSettings);
// If migrations changed the settings, persist them
const updates: Partial<AppSettings> = {};
if (migratedSettings.onboardingCompleted !== result.data.onboardingCompleted) {
updates.onboardingCompleted = migratedSettings.onboardingCompleted;
}
if (migratedSettings.language !== result.data.language) {
updates.language = migratedSettings.language;
}
if (Object.keys(updates).length > 0) {
try {
const saveResult = await window.electronAPI.saveSettings(updates);
if (!saveResult.success) {
console.warn('[settings-store] Failed to persist migrated settings', saveResult.error);
}
} catch (error) {
console.warn('[settings-store] Failed to persist migrated settings', error);
}
}
🤖 Prompt for AI Agents
In `@apps/frontend/src/renderer/stores/settings-store.ts` around lines 348 - 362,
When persisting migrated settings, don't let save failures abort the rest of the
load flow: wrap the await window.electronAPI.saveSettings(updates) call in its
own try/catch, log the error (e.g., console.error or an existing logger), and
continue so that store.setSettings(...) and markSettingsLoaded() still run;
locate this around migrateLanguageCode/migrateOnboardingCompleted, where updates
is built, and ensure the catch only handles/logs the persistence error without
rethrowing.

g1331 added 2 commits January 17, 2026 13:53
The lazy-loaded getGitBashEnv() using createRequire was failing silently
in bundled Electron apps, causing CLAUDE_CODE_GIT_BASH_PATH to not be set.

Reverted to the working pattern: direct ESM import of getToolInfo from
cli-tool-manager with explicit process.platform === 'win32' check.
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.

1 participant