Skip to content

feat(frontend): add Simplified Chinese localization#372

Open
2331221 wants to merge 2 commits into
vxcontrol:mainfrom
2331221:feat/zh-cn
Open

feat(frontend): add Simplified Chinese localization#372
2331221 wants to merge 2 commits into
vxcontrol:mainfrom
2331221:feat/zh-cn

Conversation

@2331221

@2331221 2331221 commented Jul 16, 2026

Copy link
Copy Markdown

Description of the Change

This pull request adds Simplified Chinese (zh-CN) localization support to the PentAGI frontend while preserving the existing English (en-US) interface.

Problem

PentAGI's web interface is currently English-only. Chinese-speaking users often rely on full-page browser translation, which can mutate the React DOM and cause runtime errors on dynamic pages and forms. It also produces inconsistent translations for security-specific terminology.

Solution

  • Add en-US and zh-CN resources using the existing i18next ecosystem.
  • Add browser-language detection and persistent language selection.
  • Add a reusable language switcher.
  • Localize the primary user-facing interface, including authentication, navigation, dashboards, flows, tasks, agents, tools, terminals, files, resources, knowledge documents, templates, providers, prompts, API tokens, tables, dialogs, validation messages, empty states, and errors.
  • Synchronize the document lang attribute with the selected language.
  • Keep technical identifiers, model IDs, provider names, API fields, paths, terminal output, protocol values, and user-generated content unchanged.
  • Add localization tests and internal localization documentation.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Configuration change
  • 🧪 Test update
  • 🛡️ Security update

Areas Affected

  • Core Services (Frontend UI/Backend API)
  • AI Agents (Researcher/Developer/Executor)
  • Security Tools Integration
  • Memory System (Vector Store/Knowledge Base)
  • Monitoring Stack (Grafana/OpenTelemetry)
  • Analytics Platform (Langfuse)
  • External Integrations (LLM/Search APIs)
  • Documentation
  • Infrastructure/DevOps

Testing and Verification

Test Configuration

PentAGI Version: main @ 879e87c
Docker Version: Not required for frontend validation
Host OS: Windows 11
LLM Provider: Not applicable
Enabled Features: Frontend localization (en-US and zh-CN)

Test Steps

  1. Run corepack pnpm install --frozen-lockfile in frontend.
  2. Run corepack pnpm test.
  3. Run corepack pnpm lint.
  4. Run corepack pnpm build.

Test Results

  • 22 test files passed.
  • 542 tests passed, 0 failed.
  • ESLint completed with 0 errors.
  • Production frontend build passed.
  • Remaining lint and React act(...) warnings are existing upstream warnings and do not cause test failures.

Security Considerations

Localization is applied only at the presentation boundary. Internal enum values, GraphQL identifiers, provider IDs, status comparisons, API fields, keyboard keys, and other protocol-sensitive values retain their original stable values.

No API keys, credentials, environment files, runtime data, permissions, authorization behavior, or penetration-testing safeguards are changed.

Performance Impact

The change adds lightweight client-side translation lookup and language-preference persistence. It does not add backend requests, database operations, worker processes, or changes to agent execution. The production build completes successfully.

Documentation Updates

  • README.md updates
  • API documentation updates
  • Configuration documentation updates
  • GraphQL schema updates
  • Other: added frontend/src/lib/i18n/README.md

Deployment Notes

No database migration or new environment variable is required. Frontend dependencies and the lockfile are updated for i18next and react-i18next. A normal dependency installation and frontend rebuild are sufficient.

Checklist

Code Quality

  • My code follows the project's coding standards
  • I have added/updated necessary documentation
  • I have added tests to cover my changes
  • All new and existing tests pass
  • I have run go fmt and go vet (not applicable; no Go changes)
  • I have run pnpm run lint (for TypeScript/JavaScript code)

Security

  • I have considered security implications
  • Changes maintain or improve the security model
  • Sensitive information has been properly handled

Compatibility

  • Changes are backward compatible
  • Breaking changes are clearly marked and documented
  • Dependencies are properly updated

Documentation

  • Documentation is clear and complete
  • Comments are added for non-obvious code
  • API changes are documented (no API changes)

Additional Notes

This first version prioritizes practical full-interface coverage. The translation catalog can later be split into feature-oriented namespaces if that better matches the maintainers' preferred long-term localization architecture.

Feedback is especially welcome regarding translation-key conventions, catalog organization, and language-selector placement.

@2331221
2331221 marked this pull request as ready for review July 16, 2026 05:11
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