Skip to content

refactor: translate codebase comments, error messages, and logs into English - #27

Open
IllusionOfControl wants to merge 1 commit into
Mag1cFall:mainfrom
IllusionOfControl:refactor/translate-to-english
Open

IllusionOfControl wants to merge 1 commit into
Mag1cFall:mainfrom
IllusionOfControl:refactor/translate-to-english

Conversation

@IllusionOfControl

Copy link
Copy Markdown
Contributor

refactor: translate codebase comments, error messages, and logs into English

🎯 Problem

The codebase contained widespread Chinese comments, docstrings, console logs, and error messages across all core Go packages (internal/aistudio, internal/api, internal/camoufoxnative, internal/chromeauth, internal/app, internal/config, internal/setup).

This created friction for international contributors, reduced readability in non-Chinese development environments, and resulted in inconsistent console log output formats between system logs and application errors.

🛠️ Changes

  • internal/aistudio/:
    • Translated all package, type, method, and function docstrings to idiomatic English adhering to Go conventions (// SymbolName ...).
    • Standardized sentinel error messages (ErrInvalidArgument, ErrModelNotFound, ErrNoEligibleAccount, ErrAccountNotFound, ErrAccountLeased, ErrResourceNotFound) and dynamic error wrappers.
    • Converted quota cooldown kinds (minute_quota, daily_quota) and reason messages to English.
    • Preserved protocol invariants, JSON serialization structures, and test requirements (such as substring checks for "const" in JSON schema normalization).
  • internal/api/:
    • Translated route handlers, middleware, request validation errors, and protocol compatibility layers (OpenAI, Gemini, Anthropic, Live WebSockets, Files, Media).
  • internal/camoufoxnative/:
    • Translated browser lifecycle logs, WebDriver BiDi communication errors, DOM helper messages, and isolation routines.
  • internal/chromeauth/:
    • Translated App-Bound Encryption (ABE) routines, Windows DPAPI / NCrypt decryptors, OAuth token multi-login protocol handling, and C helper (abe_helper.c).
  • internal/app/, internal/config/, internal/setup/, internal/webui/:
    • Translated runtime orchestration logs, admin event streams, configuration validation errors, and setup wizard prompts.
  • Configuration & Repo Metadata:
    • Translated comments in .env.example and .gitignore.

✅ Verification / Testing

  • Verified that 0 Chinese characters ([\u4e00-\u9fff]) remain across all Go and C source files in the repository.
  • Ran go test ./... — all unit and compatibility test suites pass cleanly.
  • Ran go build ./... — service compiles without warnings or errors.

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