feat(frontend): add Simplified Chinese localization#372
Open
2331221 wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
en-USandzh-CNresources using the existing i18next ecosystem.langattribute with the selected language.Type of Change
Areas Affected
Testing and Verification
Test Configuration
Test Steps
corepack pnpm install --frozen-lockfileinfrontend.corepack pnpm test.corepack pnpm lint.corepack pnpm build.Test Results
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
frontend/src/lib/i18n/README.mdDeployment Notes
No database migration or new environment variable is required. Frontend dependencies and the lockfile are updated for
i18nextandreact-i18next. A normal dependency installation and frontend rebuild are sufficient.Checklist
Code Quality
go fmtandgo vet(not applicable; no Go changes)pnpm run lint(for TypeScript/JavaScript code)Security
Compatibility
Documentation
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.