Skip to content

chore: translate core logs to English#9318

Merged
Soulter merged 1 commit into
masterfrom
codex/translate-core-logs
Jul 18, 2026
Merged

chore: translate core logs to English#9318
Soulter merged 1 commit into
masterfrom
codex/translate-core-logs

Conversation

@Soulter

@Soulter Soulter commented Jul 18, 2026

Copy link
Copy Markdown
Member

Summary

  • translate startup, pipeline, platform, provider, updater, and plugin-management logs to English
  • translate related runtime error messages, content-safety feedback, and dependency-conflict diagnostics
  • update affected tests to assert the English messages

Why

Core operational logs mixed Chinese and English, which made diagnostics and support workflows inconsistent. This change standardizes the affected core and plugin-management paths on English without changing their control flow.

Validation

  • uv run ruff format .
  • uv run ruff check .
  • 334 focused tests covering startup, event bus, plugin management, dashboard, pip installer, updater, media, and file-token paths
  • 115 focused tests covering platform/provider managers, lifecycle, knowledge-base resilience, and Dashboard provider paths
  • AST scans confirmed no Chinese logger literals in scope and no Chinese runtime strings in the explicitly requested modules

Summary by Sourcery

Standardize core logs, runtime errors, and content-safety messages on English while keeping behavior unchanged.

Enhancements:

  • Translate plugin management, provider, platform, updater, pipeline, and startup log messages from Chinese to clear English phrasing.
  • Align exception and diagnostic messages for dependency conflicts, file tokens, IO, and network failures with the new English logging language.
  • Clarify docstrings and inline comments for provider and platform managers to reflect current behavior and configuration semantics.

Tests:

  • Update plugin, updater, pip installer, and related tests to assert the new English log and error message text.

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. area:core The bug / feature is about astrbot's core, backend labels Jul 18, 2026

@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 call_handler (core/pipeline/context_utils.py), the new TypeError log message no longer includes which handler failed; consider logging the handler’s full name (or module + function) alongside the message to make mismatched-argument debugging easier.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `call_handler` (core/pipeline/context_utils.py), the new TypeError log message no longer includes which handler failed; consider logging the handler’s full name (or module + function) alongside the message to make mismatched-argument debugging easier.

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.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request performs a comprehensive localization of the codebase, translating user-facing messages, logs, error exceptions, and code comments from Chinese to English across various core components, services, and tests. The review feedback highlights opportunities to improve exception logging in astrbot/core/pipeline/result_decorate/stage.py by replacing manual traceback formatting with the more idiomatic exc_info=True parameter.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines 236 to 240
logger.error(
f"分段回复正则表达式错误,使用默认分段方式: {traceback.format_exc()}",
"Invalid segmented-reply regular expression; "
"using the default segmentation method: "
f"{traceback.format_exc()}",
)

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.

medium

Instead of manually formatting the traceback into the log message using traceback.format_exc(), it is more idiomatic and robust to use exc_info=True in the logger call. This keeps the log message clean and allows logging frameworks to handle the exception traceback properly.

Suggested change
logger.error(
f"分段回复正则表达式错误,使用默认分段方式: {traceback.format_exc()}",
"Invalid segmented-reply regular expression; "
"using the default segmentation method: "
f"{traceback.format_exc()}",
)
logger.error(
"Invalid segmented-reply regular expression; "
"using the default segmentation method.",
exc_info=True,
)

Comment on lines 255 to 259
logger.error(
f"分段回复过滤表达式失败,无法成功过滤:{traceback.format_exc()}"
"The segmented-reply filter expression "
"failed, so the text could not be filtered: "
f"{traceback.format_exc()}"
)

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.

medium

Instead of manually formatting the traceback into the log message using traceback.format_exc(), it is more idiomatic and robust to use exc_info=True in the logger call. This keeps the log message clean and allows logging frameworks to handle the exception traceback properly.

Suggested change
logger.error(
f"分段回复过滤表达式失败,无法成功过滤:{traceback.format_exc()}"
"The segmented-reply filter expression "
"failed, so the text could not be filtered: "
f"{traceback.format_exc()}"
)
logger.error(
"The segmented-reply filter expression "
"failed, so the text could not be filtered.",
exc_info=True,
)

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 18, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
astrbot-docs f586314 Commit Preview URL

Branch Preview URL
Jul 18 2026, 12:31 PM

@Soulter
Soulter merged commit 82d1d57 into master Jul 18, 2026
22 checks passed
@Soulter
Soulter deleted the codex/translate-core-logs branch July 18, 2026 12:19
@Soulter
Soulter restored the codex/translate-core-logs branch July 18, 2026 12:28
@Soulter
Soulter deleted the codex/translate-core-logs branch July 18, 2026 12:28
Soulter added a commit that referenced this pull request Jul 18, 2026
Soulter added a commit that referenced this pull request Jul 18, 2026
* chore: bump version to 4.26.7

* chore: translate core logs to English (#9318)

* chore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core The bug / feature is about astrbot's core, backend size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant