Skip to content

i18n: full English localization of UI, backend, roles and docs - #373

Open
jaweesh wants to merge 12 commits into
AIPentest:mainfrom
jaweesh:i18n-english
Open

jaweesh wants to merge 12 commits into
AIPentest:mainfrom
jaweesh:i18n-english

Conversation

@jaweesh

@jaweesh jaweesh commented Oct 28, 2026 •

Copy link
Copy Markdown

Summary

Full English localization of the platform while keeping Chinese protocol/wire markers byte-identical for compatibility with historical rows and frontend regexes.

  • Roles/agents/skills/tools: Chinese-named role YAMLs renamed to English, prompts/descriptions/tags translated (Chinese docs preserved as README_CN.md)
  • Backend: fmt.Errorf, zap logs and handler responses localized by request language via respondError/respondErrorf/i18nText dual-accept; protocol markers (toolGuardBlockedPrefix, prepare.go validation errors matched by multiAgentHTTPErrorStatus) kept Chinese byte-identical
  • Frontend: en-US/ru-RU i18n keys filled with contract across all frontend JS; hardcoded Chinese UI strings translated; dual-accept for legacy Chinese rows (execution-failed prefixes, default role, c2 events)
  • Docs/plugins: README, CHANGELOG, docs/zh-CN, Burp extension labels, browser-extension panel

Backends dual-accept both Chinese (historical rows) and English (new rows) text; frontend .test.cjs suites and backend package tests pass (only pre-existing environment failures remain).

jaweesh and others added 12 commits October 28, 2026 10:05
…anguage

Convert all c.JSON error/message sites in internal/handler to
respondError/respondErrorf/i18nText per Accept-Language / ?lang=,
covering zh/en for every user-visible failure:
- 431 respondError sites well-shaped (was 281); English-only literals
  in c2/chat_uploads/webshell/notification/async_agent_runs and
  vulnerability_retest now carry zh translations
- prefix+err.Error() concat sites folded into respondErrorf
- upstream-extracted async runners (runSingleJSON/runMultiJSON/
  runWorkflowJSON/executeAcceptedRunBody) now thread wantEnglish,
  captured before the goroutine starts
- upstream tests updated for the new signatures

Frontend: settingsAudit.msg merged into all three locales; audit.js
maps stored-text to i18n keys; knowledge.js knowledgeT guard hardened;
test slice markers made line-ending tolerant (CRLF checkouts).

Co-Authored-By: Claude Code <noreply@anthropic.com>
- chat-i18n-keys.test.cjs: every chat.js key via chatTranslate /
  conversationSidebarText / window.t must exist in zh-CN, en-US, ru-RU
- all-i18n-keys.test.cjs: same contract for all web/static/js/*.js,
  resolving helper-prefix short keys (xxxT -> 'ns.' + key) and treating
  ICU plural _one/_other pairs in en-US as satisfying the plain key
- fill ru-RU to full key parity with en-US/zh-CN (timeline, wechat,
  settings/workflows gaps: botTokenPlaceholder, botUsernamePlaceholder,
  inspectionRequired)
- add missing hitl keys in all locales: workflowPendingTitle,
  openConversation, submitFailed

330 frontend tests pass.

Co-Authored-By: Claude Code <noreply@anthropic.com>
i18n-migrate stats counts any Chinese line uncovered; most are comments,
console logs, keyed fallback-map entries, and keyed-with-fallback helper
calls spanning lines the line-level regex misses. audit-uncovered-context
takes +/-3 lines of context for the covered check, skips keyed
'ns.key': '中文' fallback-map entries, console, and trailing zh comments,
and prints per-file truly-uncovered sites (349 across 22 files after
filtering from 3929 raw).

Co-Authored-By: Claude Code <noreply@anthropic.com>
The i18n error migration inserted fmt.Sprintf calls into storage,
wechat_robot, workflow and workflow_run without importing fmt; go
build failed with 'undefined: fmt'. Add the import to each.

Co-Authored-By: Claude Code <noreply@anthropic.com>
respondError/respondErrorf never reference net/http symbols; the stray
import failed the build with 'imported and not used'.

Co-Authored-By: Claude Code <noreply@anthropic.com>
skills/*/SKILL.md frontmatter descriptions showed raw Chinese in the
Skills page ('内网域攻击:BloodHound…'). skillDisplayDescription already
had the seed-translation pattern (skills.seedDescriptions.<id>) but only
cyberstrike-eino-demo was ever filled; user-edited descriptions stay as
original text by design.

- fill SEED_SKILL_DESCRIPTIONS in skills.js with all 23 seed skills'
frontmatter descriptions (exact-match gate)
- add skills.seedDescriptions.* to zh-CN (23), en-US (23, translated),
  ru-RU (23, en values as ru fallback per repo convention)

330 frontend tests pass.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Skill cards showed raw frontmatter tags ('渗透测试', '红队'). Add
skillDisplayTag with the seed-translation pattern used for descriptions:
seed tag values map to skills.seedTags.<tag> and translate; non-seed or
user-edited values render as-is.

- zh-CN: 渗透测试 / 红队 / 项目黑板 (identity)
- en-US: penetration-testing / red-team / project blackboard
- ru-RU: en values as ru fallback per repo convention

330 frontend tests pass.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Rename Chinese-named role YAML files to English names, translate
descriptions, user prompts, tool descriptions and seed skill tags.
Chinese docs preserved as tools/README_CN.md.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Localize fmt.Errorf, zap logger messages and handler responses by
request language (respondError/respondErrorf/i18nText dual-accept).
Protocol and wire markers (toolGuardBlockedPrefix, prepare.go
validation errors matched by multiAgentHTTPErrorStatus, historical
DB prefixes) stay byte-identical Chinese; frontends dual-accept.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Fill en-US/ru-RU i18n keys (contract over all frontend JS), translate
hardcoded Chinese UI strings, and dual-accept legacy Chinese text
(execution-failed prefixes, role default, c2 events) for historical
rows. Front .test.cjs suites pass.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Translate top-level README (Chinese preserved as README_CN.md),
CHANGELOG, docs/zh-CN pages, Burp Java extension labels, and the
browser-extension panel.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The translated description contains ": " sequences which YAML cannot
parse as a plain scalar (mapping values are not allowed), breaking
skill loading with getRunFunc error. Quote it as a single-quoted
scalar so parsing succeeds again.

Co-Authored-By: Claude Code <noreply@anthropic.com>
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