Skip to content

批量将代码注释和文档注释翻译为中文 - #126

Merged
Soar360 merged 1 commit into
mainfrom
chore/translate-comments-zh
Aug 7, 2026
Merged

批量将代码注释和文档注释翻译为中文#126
Soar360 merged 1 commit into
mainfrom
chore/translate-comments-zh

Conversation

@Soar360

@Soar360 Soar360 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

本次提交将项目中 Check、Guard、Helpers、DataConvert、RecordColumn、RecordTable、Ascii85、LzString、DimensionKind、UnitConverter、IPAddressExtensions、SingleInstanceManager 等多个类和文件的英文注释和 XML 文档注释翻译为中文,保留类型和参数名等英文关键字。仅修改注释文本,未更改任何代码逻辑。部分注释内容根据中文开发者习惯进行了优化和补充,所有文件均保持 UTF-8 编码,符合项目规范。

本次提交将项目中 Check、Guard、Helpers、DataConvert、RecordColumn、RecordTable、Ascii85、LzString、DimensionKind、UnitConverter、IPAddressExtensions、SingleInstanceManager 等多个类和文件的英文注释和 XML 文档注释翻译为中文,保留类型和参数名等英文关键字。仅修改注释文本,未更改任何代码逻辑。部分注释内容根据中文开发者习惯进行了优化和补充,所有文件均保持 UTF-8 编码,符合项目规范。
Copilot AI lite review requested due to automatic review settings August 7, 2026 05:47

Copilot AI 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.

Pull request overview

This pull request updates multiple files by translating existing inline comments and XML documentation comments from English to Chinese, without changing runtime logic.

Changes:

  • Translated XML doc comments (e.g., <summary>, <remarks>, <param>, <returns>) to Chinese across several public/internal APIs.
  • Translated various inline implementation comments to Chinese in helpers/encoders/hashing and build scripts.
  • Removed one commented-out line in Crc32.cs (still a comment-only change).

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
src/LuYao.Common/Threading/SingleInstanceManager.cs Translates class/member XML docs and a couple of inline comments to Chinese.
src/LuYao.Common/Net/IPAddressExtensions.cs Translates the class summary XML doc to Chinese.
src/LuYao.Common/IO/Hashing/Murmur128.cs Translates inline hashing comments to Chinese.
src/LuYao.Common/IO/Hashing/Crc32.cs Removes a commented-out line and translates an inline comment to Chinese.
src/LuYao.Common/Guard.cs Translates XML documentation across multiple Guard helper methods to Chinese.
src/LuYao.Common/Globalization/UnitConverter.cs Translates a few inline “additional units” comments to Chinese.
src/LuYao.Common/Globalization/DimensionKind.cs Translates the enum summary XML doc to Chinese.
src/LuYao.Common/Encoders/LzString.cs Translates several inline compression/decompression comments to Chinese.
src/LuYao.Common/Encoders/Ascii85.cs Translates remarks/author line and multiple inline comments to Chinese.
src/LuYao.Common/Data/RecordTable.cs Translates multiple inline Unicode-range comments to Chinese.
src/LuYao.Common/Data/RecordColumn.T.cs Translates one inline comment to Chinese.
src/LuYao.Common/Data/Internal/DataConvert.cs Translates the class summary XML doc to Chinese.
src/LuYao.Common/Data/Helpers.cs Translates XML summary and some inline mapping comments to Chinese.
src/LuYao.Common/Check.cs Translates many XML doc blocks for argument-validation helpers to Chinese.
build/Build.cs Translates header comments to Chinese and replaces a previously-garbled inline comment (but with Chinese text).
Suppressed comments (1)

build/Build.cs:73

  • Project guidance requires code comments to be written in English (see .github/copilot-instructions.md:4). This inline comment was changed to Chinese; please keep it in English. (Also, replacing the previously-garbled text is good, but the replacement should still be English.)
                .SetVersion(PackageVersion) // 这里设置版本
                .EnableNoBuild());

Comment on lines 11 to 14
/// <summary>
/// Provides single-instance process management. Ensures only one instance of the
/// application runs at a time, and allows the new instance to signal the existing
/// one to activate its window via a named pipe.
/// 提供单实例进程管理,确保应用程序每次只有一个实例运行,
/// 并允许新实例通过命名管道通知现有实例激活窗口。
/// </summary>
Comment on lines 6 to 8
/// <summary>
/// Provides extension methods for the <see cref="IPAddress"/> class.
/// <see cref="IPAddress"/> 类提供扩展方法。
/// </summary>
Comment on lines +99 to +103
// 创建我们的密钥并初始化为 0
ulong k1 = 0,
k2 = 0;

// determine how many bytes we have left to work with based on length
// 根据长度确定我们还剩下多少字节可以使用
public static uint reflect(uint crc, int bitnum)
{
// reflects the lower 'bitnum' bits of 'crc'
// 反映“crc”的较低“bitnum”位
Comment thread src/LuYao.Common/Guard.cs
Comment on lines 6 to 9
/// <summary>
/// Provides guarded execution helpers to reduce try/catch boilerplate
/// while keeping behavior observable and configurable.
/// 提供受保护的执行帮助程序以减少 try/catch 样板文件
/// 同时保持行为可观察和可配置。
/// </summary>
Comment thread build/Build.cs
Comment on lines +17 to +21
/// 可使用以下支持插件:
/// - JetBrains ReSharper https://nuke.build/resharper
/// - JetBrains Rider https://nuke.build/rider
/// - Microsoft Visual Studio https://nuke.build/visualstudio
/// - Microsoft VS Code https://nuke.build/vscode
static bool IsWide(char c)
{
// CJK Unified Ideographs, CJK Extension A, Compatibility Ideographs
// CJK 统一表意文字、CJK 扩展 A、兼容性表意文字
Comment on lines 11 to 13
/// <remarks>
/// Jeff Atwood
/// 杰夫·阿特伍德
/// http://www.codinghorror.com/blog/archives/000410.html
Comment on lines 44 to 46
/// <summary>
/// From CLR <see cref="Type"/> get its <see cref="RecordColumnType"/>.
/// CLR <see cref="Type"/> 获取其 <see cref="RecordColumnType"/>
/// </summary>
Comment thread src/LuYao.Common/Check.cs
Comment on lines 7 to 10
/// <summary>
/// Provides a collection of static methods for argument validation.
/// Validates arguments to reduce boilerplate parameter checking code.
/// 提供一组用于参数验证的静态方法。
/// 验证参数以减少样板参数检查代码。
/// </summary>
@Soar360
Soar360 merged commit cdc1cf7 into main Aug 7, 2026
2 checks passed
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