Skip to content

Translate entire project from Chinese to English#5

Open
ChaoticSi1ence wants to merge 2 commits intoTIANLI0:mainfrom
ChaoticSi1ence:main
Open

Translate entire project from Chinese to English#5
ChaoticSi1ence wants to merge 2 commits intoTIANLI0:mainfrom
ChaoticSi1ence:main

Conversation

@ChaoticSi1ence
Copy link
Copy Markdown

@ChaoticSi1ence ChaoticSi1ence commented Mar 20, 2026

⚠️ Important Note / 重要说明

English:
This is a full rewrite of all Chinese text to English — not a supplement or i18n addition. Merging this will replace all Chinese UI text, comments, log messages, error messages, and documentation with English equivalents. Chinese users would lose their native language interface.

This PR is best suited as:

  • A reference for adding English language support via an i18n system
  • A starting point if you want to maintain a separate English branch
  • Documentation of what an English translation would look like

If this doesn't fit your project's direction, no worries — the English version is available as a standalone fork at ChaoticSi1ence/BS2PRO-Controller for English-speaking users.

中文:
这是一个将所有中文文本完全重写为英文的 PR —— 不是补充翻译,也不是国际化(i18n)方案。合并此 PR 将会替换所有中文界面文本、注释、日志信息、错误信息和文档为英文。中文用户将失去中文界面。

此 PR 更适合作为:

  • 通过 i18n 系统添加英文支持的参考
  • 维护单独英文分支的起点
  • 英文翻译效果的展示

如果这不符合您的项目方向,完全没有问题 —— 英文版本已作为独立 Fork 发布在 ChaoticSi1ence/BS2PRO-Controller,供英文用户使用。


Summary / 概述

  • Translates all UI text, comments, log messages, error messages, installer strings, documentation, and scripts to English across 51 files

  • Firmware protocol values and backward-compatible string matching are intentionally preserved in Chinese to maintain device compatibility

  • Adds GitHub Actions CI workflow for automated builds

  • 将 51 个文件中的所有界面文本、注释、日志信息、错误信息、安装程序字符串、文档和脚本翻译为英文

  • 固件协议值和向后兼容的字符串匹配有意保留为中文,以确保设备通信正常

  • 新增 GitHub Actions CI 工作流用于自动化构建

Files Changed / 修改的文件

  • Go 后端 (20 files): All internal/ packages, main.go, app.go, cmd/core/*
  • 前端 (12 files): All React components, services, store, types
  • C# 桥接 (1 file): TempBridge/Program.cs
  • 安装程序 (1 file): project.nsi — all UI text, language changed to English
  • 脚本 (7 files): Python/Go utility scripts
  • 文档 (3 files): README.md, bridge/README.md, data docs
  • 配置 (3 files): wails.json, build_bridge.bat, .vscode/tasks.json
  • CI (1 file): New .github/workflows/build.yml

Intentionally Preserved Chinese Strings / 有意保留的中文字符串

  • cmd/core/app.go: Device firmware protocol values used in equality comparisons against device-returned data / 设备固件协议值,用于与设备返回数据进行匹配
  • internal/autostart/autostart.go: Chinese Windows schtasks error message check alongside English equivalents / 中文 Windows 系统 schtasks 错误信息检查(同时保留英文)
  • internal/device/device.go: Dual-language gear level matching for backward compatibility / 双语档位匹配,确保向后兼容

Test Plan / 测试计划

  • CI build passes on GitHub Actions / CI 构建在 GitHub Actions 上通过 (Go + Next.js + C# + NSIS)
  • Manual testing with BS2/BS2PRO hardware device / 使用 BS2/BS2PRO 硬件设备进行手动测试
  • Verify installer UI displays correctly in English / 验证安装程序界面正确显示英文

🤖 Generated with Claude Code

ChaoticSi1ence and others added 2 commits March 20, 2026 13:06
Translates all UI text, comments, log messages, error messages, installer
strings, documentation, and scripts to English across 51 files. Firmware
protocol values and backward-compatible string matching are intentionally
preserved in Chinese. Also adds GitHub Actions CI workflow for automated builds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace typographic quotes (U+201C/U+201D) with standard double quotes
at line 1035 placeholder attribute.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@TIANLI0
Copy link
Copy Markdown
Owner

TIANLI0 commented Mar 22, 2026

最近比较忙,我有空审一下

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces Chinese UI strings, logs, comments, and documentation across the project with English equivalents, and adds a Windows CI build workflow.

Changes:

  • Translates user-facing strings and developer-facing text (comments/logs/docs) across Go backend, Next.js frontend, scripts, and bridge/installer assets.
  • Updates some domain identifiers (e.g., manual gear names/levels) to English.
  • Adds a GitHub Actions workflow to build the app and publish artifacts on Windows.

Reviewed changes

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

Show a summary per file
File Description
wails.json Translates app metadata comment string.
scripts/temp/temp.go Translates comments and console output strings in the temp hardware info script.
scripts/rpm_rgb_probe.py Translates CLI help text, markdown output, and console messages.
scripts/hid_data.md Translates HID packet notes/documentation.
scripts/hid_controller.go Translates comments and console output strings for HID test tool.
scripts/ble_write.py Translates messages/comments for BLE exploration tool.
scripts/ble_read.py Translates messages/comments for BLE monitor tool.
scripts/ble_data.md Translates BLE packet capture notes.
main.go Translates log messages and comments for core-service launch/second-instance logic.
internal/version/version.go Translates version module comments.
internal/types/types.go Translates type comments; changes default config strings and gear command identifiers.
internal/tray/tray.go Translates tray UI strings and log messages.
internal/temperature/temperature.go Translates bridge/fallback messages and comments.
internal/smartcontrol/target.go Translates comments.
internal/smartcontrol/learning.go Translates comments.
internal/smartcontrol/helpers.go Translates comments.
internal/smartcontrol/doc.go Translates package doc comment.
internal/smartcontrol/config.go Translates comments.
internal/notifier/notifier.go Translates notification default title and log message.
internal/logger/logger.go Translates comments and error messages.
internal/ipc/ipc.go Translates IPC comments and error/log messages.
internal/hotkey/manager.go Translates comments and error/log messages.
internal/device/rgb.go Translates error messages and comments in RGB control.
internal/config/config.go Translates config manager log/error messages and comments.
internal/bridge/bridge.go Translates bridge manager logs/errors and comments.
internal/autostart/autostart.go Translates messages and expands schtasks “not found” matching.
frontend/src/app/types/app.ts Translates TS type comments.
frontend/src/app/store/app-store.ts Translates user-visible error/toast strings and console logs.
frontend/src/app/services/api.ts Translates comments in API wrapper.
frontend/src/app/lib/manualGearPresets.ts Translates/renames manual gear preset strings to English.
frontend/src/app/layout.tsx Translates app description metadata.
frontend/src/app/components/ui/index.tsx Translates default select placeholder.
frontend/src/app/components/FanCurveProfileSelect.tsx Translates placeholder and empty-state label.
frontend/src/app/components/DeviceStatus.tsx Translates UI strings and labels.
frontend/src/app/components/AppShell.tsx Translates tab titles and accessibility label.
frontend/src/app/components/AppFatalError.tsx Translates fatal error UI strings.
cmd/core/main.go Translates comments and panic/log messages in core entrypoint.
cmd/core/curve_profiles.go Translates curve profile names and error messages.
cmd/core/crash_report.go Translates crash report stderr/log output.
build_bridge.bat Translates build script output strings.
bridge/TempBridge/Program.cs Translates console output and exception/error strings.
bridge/README.md Translates bridge build/usage documentation.
app.go Translates GUI-side logs, comments, and API method docstrings.
README.md Translates top-level project documentation.
.vscode/tasks.json Translates task failure strings.
.github/workflows/build.yml Adds Windows CI build workflow (Go/Node/Bun/.NET/NSIS + artifacts).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +207 to +214
// GearCommands contains preset gear commands
var GearCommands = map[string][]GearCommand{
"静音": {
{"1挡低", []byte{0x5a, 0xa5, 0x26, 0x05, 0x00, 0x14, 0x05, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 1300},
{"1挡中", []byte{0x5a, 0xa5, 0x26, 0x05, 0x00, 0xa4, 0x06, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 1700},
{"1挡高", []byte{0x5a, 0xa5, 0x26, 0x05, 0x00, 0x6c, 0x07, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 1900},
"Silent": {
{"Gear1-Low", []byte{0x5a, 0xa5, 0x26, 0x05, 0x00, 0x14, 0x05, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 1300},
{"Gear1-Mid", []byte{0x5a, 0xa5, 0x26, 0x05, 0x00, 0xa4, 0x06, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 1700},
{"Gear1-High", []byte{0x5a, 0xa5, 0x26, 0x05, 0x00, 0x6c, 0x07, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 1900},
},
"标准": {
{"2挡低", []byte{0x5a, 0xa5, 0x26, 0x05, 0x01, 0x34, 0x08, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 2100},
{"2挡中", []byte{0x5a, 0xa5, 0x26, 0x05, 0x01, 0x60, 0x09, 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 2310},
{"2挡高", []byte{0x5a, 0xa5, 0x26, 0x05, 0x01, 0x8c, 0x0a, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 2760},
"Standard": {
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

GearCommands keys and preset names were translated (e.g., "Silent", "Standard", ...) which changes the API/config values used by SetManualGear (it indexes types.GearCommands[gear]). This will break existing configs/clients that still send the previous gear identifiers, and it also doesn't match the current frontend preset value "Quiet". Consider keeping stable, non-localized gear IDs (e.g., canonical constants) and only translating display labels in the UI, or provide an explicit backward-compatible alias map.

Copilot uses AI. Check for mistakes.
Comment on lines +209 to 223
"Silent": {
{"Gear1-Low", []byte{0x5a, 0xa5, 0x26, 0x05, 0x00, 0x14, 0x05, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 1300},
{"Gear1-Mid", []byte{0x5a, 0xa5, 0x26, 0x05, 0x00, 0xa4, 0x06, 0xd5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 1700},
{"Gear1-High", []byte{0x5a, 0xa5, 0x26, 0x05, 0x00, 0x6c, 0x07, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 1900},
},
"标准": {
{"2挡低", []byte{0x5a, 0xa5, 0x26, 0x05, 0x01, 0x34, 0x08, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 2100},
{"2挡中", []byte{0x5a, 0xa5, 0x26, 0x05, 0x01, 0x60, 0x09, 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 2310},
{"2挡高", []byte{0x5a, 0xa5, 0x26, 0x05, 0x01, 0x8c, 0x0a, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 2760},
"Standard": {
{"Gear2-Low", []byte{0x5a, 0xa5, 0x26, 0x05, 0x01, 0x34, 0x08, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 2100},
{"Gear2-Mid", []byte{0x5a, 0xa5, 0x26, 0x05, 0x01, 0x60, 0x09, 0x95, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 2310},
{"Gear2-High", []byte{0x5a, 0xa5, 0x26, 0x05, 0x01, 0x8c, 0x0a, 0xc2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 2760},
},
"强劲": {
{"3挡低", []byte{0x5a, 0xa5, 0x26, 0x05, 0x02, 0xf0, 0x0a, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 2800},
{"3挡中", []byte{0x5a, 0xa5, 0x26, 0x05, 0x02, 0xb8, 0x0b, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 3000},
{"3挡高", []byte{0x5a, 0xa5, 0x26, 0x05, 0x02, 0xe4, 0x0c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 3300},
"Power": {
{"Gear3-Low", []byte{0x5a, 0xa5, 0x26, 0x05, 0x02, 0xf0, 0x0a, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 2800},
{"Gear3-Mid", []byte{0x5a, 0xa5, 0x26, 0x05, 0x02, 0xb8, 0x0b, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 3000},
{"Gear3-High", []byte{0x5a, 0xa5, 0x26, 0x05, 0x02, 0xe4, 0x0c, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, 3300},
},
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

The command names/levels here use "Low/Mid/High" (capitalized and "Mid"), but the current manual-gear selection logic in internal/device/device.go matches levels via strings.Contains(cmd.Name, "low"|"medium"|"high") and switch cases that include "medium" (not "Mid"). With the new names, no command will be selected and manual gear setting will fail. Fix by normalizing case when matching and accepting "mid"/"medium" consistently, or change these command names to include the expected tokens.

Copilot uses AI. Check for mistakes.
Comment on lines 260 to 281
@@ -276,13 +276,13 @@ func GetDefaultConfig(isAutoStart bool) AppConfig {
TempUpdateRate: 2,
TempSampleCount: 1,
ConfigPath: "",
ManualGear: "标准",
ManualLevel: "",
ManualGear: "Standard",
ManualLevel: "Mid",
DebugMode: false,
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

Default config values use ManualGearLevels entries like "Mid" and ManualLevel: "Mid", but the backend manual-gear handler currently recognizes levels like "medium"/"low"/"high" (and Chinese equivalents). This default will cause manual gear selection to fail unless the handler also accepts "Mid". Align the stored config values with the accepted level vocabulary (or update the handler to accept both).

Copilot uses AI. Check for mistakes.
Comment on lines 14 to 24
export const MANUAL_GEAR_PRESETS: ManualGearPreset[] = [
{
gear: '静音',
gear: 'Quiet',
colorClass: 'text-emerald-500',
borderClass: 'border-emerald-500/50',
bgClass: 'bg-emerald-500/12',
levels: [
{ level: '', rpm: 1300 },
{ level: '', rpm: 1700 },
{ level: '', rpm: 1900 },
{ level: 'Low', rpm: 1300 },
{ level: 'Mid', rpm: 1700 },
{ level: 'High', rpm: 1900 },
],
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

The frontend manual gear preset uses gear: 'Quiet', but the backend preset command map uses the key "Silent" (and SetManualGear indexes by the provided string). This mismatch will make manual gear selection fail. Use the same canonical gear identifiers across frontend/backend (e.g., "Silent") and translate only the user-facing label.

Copilot uses AI. Check for mistakes.
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

actions/setup-go is pinned to Go 1.23, but go.mod declares go 1.26.0. This will cause CI failures or unexpected behavior when module/toolchain features differ. Prefer go-version-file: go.mod or update go-version to match the required Go toolchain.

Suggested change
go-version: '1.23'
go-version-file: 'go.mod'

Copilot uses AI. Check for mistakes.
- **go-hid**HID 设备通信
- **zap**:日志记录
### Backend
- **Go 1.25+**: Primary development language
Copy link

Copilot AI Mar 30, 2026

Choose a reason for hiding this comment

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

README lists two different minimum Go versions: "Go 1.25+" under Tech Stack and "Go 1.21+" under Required Software. This is confusing for contributors and should be reconciled to a single supported minimum (ideally matching go.mod).

Suggested change
- **Go 1.25+**: Primary development language
- **Go**: Primary development language

Copilot uses AI. Check for mistakes.
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.

3 participants