Skip to content

🌐 chore: translate non-English comments to English in packages/openapi/src/controllers#13146

Merged
arvinxx merged 1 commit into
canaryfrom
automatic/translate-comments-packages-openapi-controllers-2026-03-20
Mar 20, 2026
Merged

🌐 chore: translate non-English comments to English in packages/openapi/src/controllers#13146
arvinxx merged 1 commit into
canaryfrom
automatic/translate-comments-packages-openapi-controllers-2026-03-20

Conversation

@lobehubbot

@lobehubbot lobehubbot commented Mar 20, 2026

Copy link
Copy Markdown
Member

Summary

  • Translated non-English (Chinese) comments to English in packages/openapi/src/controllers
  • Total lines changed: 236 lines
  • Files affected: 11 files

Changes

  • All non-English comments translated to English
  • Code functionality unchanged
  • Comment formatting preserved

Module Processed

packages/openapi/src/controllers


🤖 Generated with Claude Code

Summary by Sourcery

Translate controller comments in the OpenAPI package to English for consistency and clarity across the codebase.

Enhancements:

  • Standardize and clarify controller-level and method-level comments in OpenAPI controllers by translating them from Chinese to English.

Documentation:

  • Align inline and JSDoc-style comments in OpenAPI controllers with English-language documentation conventions, without changing runtime behavior.

…i/src/controllers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lobehub Ready Ready Preview, Comment Mar 20, 2026 3:20am

Request Review

@sourcery-ai

sourcery-ai Bot commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

This PR standardizes documentation by translating all previously Chinese comments and JSDoc in the OpenAPI controllers under packages/openapi/src/controllers to English, without changing any runtime behavior or signatures.

File-Level Changes

Change Details Files
Translated all controller-level and method-level comments in file.controller to English while preserving code and comment structure.
  • Updated class and method JSDoc summaries from Chinese to English for all file-related endpoints (upload, batch upload, parse, chunking, queries, CRUD).
  • Translated inline comments describing requireAuth guarantees, form-data handling, query parsing, and option construction.
  • Kept method signatures, routing, and business logic identical to the previous version.
packages/openapi/src/controllers/file.controller.ts
Localized user-related controller documentation to English in user.controller.
  • Translated class-level description and all method JSDoc (CRUD, role management, listing) from Chinese to English.
  • Updated inline comments about obtaining DB connections, creating service instances, and validating request bodies.
  • Preserved all request/response types, routes, and implementation logic.
packages/openapi/src/controllers/user.controller.ts
Translated agent and agent-group controller comments to English.
  • Updated AgentGroupController JSDoc and descriptions of list, detail, create, update, and delete endpoints to English.
  • Updated AgentController JSDoc and descriptions for listing, creating, updating, deleting, and fetching agents by ID to English.
  • No functional or type changes beyond comment text.
packages/openapi/src/controllers/agent-group.controller.ts
packages/openapi/src/controllers/agent.controller.ts
Converted knowledge base controller documentation from Chinese to English.
  • Translated class JSDoc and endpoint descriptions for listing, reading, creating, updating, deleting knowledge bases.
  • Translated comments for bulk file operations within a knowledge base (add, remove, move, list).
  • Left all HTTP behavior and service interactions unchanged.
packages/openapi/src/controllers/knowledge-base.controller.ts
Updated messaging- and topic-related controller comments to English for consistency.
  • Translated MessageController JSDoc for unified count/list, CRUD, and reply-generation endpoints, including inline comments for query preprocessing.
  • Translated TopicController JSDoc for list, get, create, update, and delete operations.
  • Ensured comment formatting and structure are preserved while only changing natural language text.
packages/openapi/src/controllers/message.controller.ts
packages/openapi/src/controllers/topic.controller.ts
Translated chat and message translation controller documentation to English.
  • Updated ChatController endpoint descriptions for general chat, translation, and reply generation, including notes about streaming behavior.
  • Translated MessageTranslationController JSDoc for getting, creating, updating, and deleting translations of messages.
  • Kept all controller logic and types intact.
packages/openapi/src/controllers/chat.controller.ts
packages/openapi/src/controllers/message-translation.controller.ts
Standardized model and provider controller comments to English.
  • Translated ModelController JSDoc for list, detail, create, and update endpoints.
  • Updated ProviderController class description comment from Chinese to English.
  • No code paths, signatures, or exports were modified.
packages/openapi/src/controllers/model.controller.ts
packages/openapi/src/controllers/provider.controller.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • In UserController.updateUserRoles, the error message '请求体不能为空' is still in Chinese while the rest of the controller comments are now English; consider updating this string (and any similar user-facing messages) for consistency.
  • Some translated comments are slightly awkward English (e.g. Retrieves the model list endpoint, Batch retrieves file details and content); a quick pass to smooth these to more natural phrases like Retrieves the model list or Retrieves file details and content in batch would improve readability.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `UserController.updateUserRoles`, the error message `'请求体不能为空'` is still in Chinese while the rest of the controller comments are now English; consider updating this string (and any similar user-facing messages) for consistency.
- Some translated comments are slightly awkward English (e.g. `Retrieves the model list endpoint`, `Batch retrieves file details and content`); a quick pass to smooth these to more natural phrases like `Retrieves the model list` or `Retrieves file details and content in batch` would improve readability.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@lobehubbot

Copy link
Copy Markdown
Member Author

@nekomeowww - This PR translates Chinese comments to English in the OpenAPI controllers package. Please take a look.

@codecov

codecov Bot commented Mar 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.60%. Comparing base (04f963d) to head (d79cc4e).
⚠️ Report is 12 commits behind head on canary.

Additional details and impacted files
@@           Coverage Diff           @@
##           canary   #13146   +/-   ##
=======================================
  Coverage   74.60%   74.60%           
=======================================
  Files        1514     1514           
  Lines      124476   124477    +1     
  Branches    13790    13790           
=======================================
+ Hits        92862    92865    +3     
+ Misses      31503    31501    -2     
  Partials      111      111           
Flag Coverage Δ
app 67.68% <ø> (+<0.01%) ⬆️
database 97.89% <ø> (ø)
packages/agent-runtime 89.60% <ø> (ø)
packages/context-engine 83.53% <ø> (ø)
packages/conversation-flow 92.37% <ø> (ø)
packages/file-loaders 87.02% <ø> (ø)
packages/memory-user-memory 66.68% <ø> (ø)
packages/model-bank 99.84% <ø> (ø)
packages/model-runtime 84.72% <ø> (ø)
packages/prompts 74.60% <ø> (ø)
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/utils 90.09% <ø> (ø)
packages/web-crawler 88.81% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 66.25% <ø> (ø)
Services 49.90% <ø> (ø)
Server 69.89% <ø> (+<0.01%) ⬆️
Libs 42.20% <ø> (ø)
Utils 91.09% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@arvinxx arvinxx merged commit 9d441c5 into canary Mar 20, 2026
22 of 23 checks passed
@arvinxx arvinxx deleted the automatic/translate-comments-packages-openapi-controllers-2026-03-20 branch March 20, 2026 09:13
@lobehubbot

Copy link
Copy Markdown
Member Author

❤️ Great PR @lobehubbot ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.

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.

2 participants