Add Chinese (Simplified) localization#30
Conversation
Kobe9312
commented
Feb 26, 2026
- Translate all UI text to Chinese
- Add Chinese README
- Add Chinese notification categorization docs
- Include menu items, dialogs, and window titles
- Translate all UI text to Chinese - Add Chinese README - Add Chinese notification categorization docs - Include menu items, dialogs, and window titles
There was a problem hiding this comment.
Pull request overview
Adds Simplified Chinese text across the WinUI tray app UI and introduces Chinese-language documentation to support Chinese-speaking users of OpenClaw Windows Hub.
Changes:
- Translates WinUI window titles, labels, tooltips, and tray menu strings into Simplified Chinese.
- Adds Simplified Chinese notification categorization documentation (
NOTIFICATION_CATEGORIZATION_zh.md). - Adds a Simplified Chinese README (
README_zh.md).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/OpenClaw.Tray.WinUI/Windows/WebChatWindow.xaml | Translates Web Chat window title/tooltips/error UI text. |
| src/OpenClaw.Tray.WinUI/Windows/StatusDetailWindow.xaml | Translates status detail window UI labels/headers. |
| src/OpenClaw.Tray.WinUI/Windows/SettingsWindow.xaml | Translates settings UI (connection/startup/notifications/advanced sections). |
| src/OpenClaw.Tray.WinUI/Windows/NotificationHistoryWindow.xaml | Translates notification history window labels and empty state. |
| src/OpenClaw.Tray.WinUI/Windows/CanvasWindow.xaml | Translates canvas window title and error UI. |
| src/OpenClaw.Tray.WinUI/Windows/ActivityStreamWindow.xaml | Translates activity stream title, filter labels, empty state, footer actions. |
| src/OpenClaw.Tray.WinUI/Dialogs/WelcomeDialog.cs | Translates welcome dialog UI strings (and some developer-facing comments/docs). |
| src/OpenClaw.Tray.WinUI/App.xaml.cs | Translates tray popup menu item labels/headers/actions. |
| docs/NOTIFICATION_CATEGORIZATION_zh.md | Adds Chinese documentation for notification categorization behavior and settings. |
| README_zh.md | Adds Chinese README covering build/run/features and node mode usage. |
Comments suppressed due to low confidence (3)
src/OpenClaw.Tray.WinUI/Dialogs/WelcomeDialog.cs:28
- Inline developer comments were translated to Chinese here, but the surrounding codebase keeps implementation comments in English. For consistency and long-term maintainability, consider reverting implementation comments to English (while keeping UI strings localized).
// 应用 Mica 背景以获得现代 Windows 11 外观
SystemBackdrop = new MicaBackdrop();
// 直接在窗口中构建 UI(不需要 ContentDialog)
src/OpenClaw.Tray.WinUI/Windows/StatusDetailWindow.xaml:55
ProviderSummaryText's fallback text was translated to "无" here, butStatusDetailWindow.xaml.csstill sets it to the hardcoded string "n/a" whenusage.ProviderSummaryis empty. This will reintroduce English in the translated UI; update the code-behind fallback string (or centralize localization) so the actual displayed value is localized.
<TextBlock Grid.Row="2" Grid.Column="0" Text="提供商:"/>
<TextBlock x:Name="ProviderSummaryText" Grid.Row="2" Grid.Column="1"
Text="无" FontWeight="SemiBold" TextWrapping="Wrap"/>
src/OpenClaw.Tray.WinUI/App.xaml.cs:873
- These menu labels localize the surrounding text, but still display raw session values like
ThinkingLevel/VerboseLeveland the toggledon/offstrings (andnextVerboseis used both for display and the action payload). This produces mixed-language UI (e.g., "详细模式: off → on"). Keep the action payload values stable (on/off) but map them to localized display strings separately for the menu text.
var currentThinking = string.IsNullOrWhiteSpace(session.ThinkingLevel) ? "off" : session.ThinkingLevel;
var currentVerbose = string.IsNullOrWhiteSpace(session.VerboseLevel) ? "off" : session.VerboseLevel;
var nextVerbose = string.Equals(currentVerbose, "on", StringComparison.OrdinalIgnoreCase) ? "off" : "on";
menu.AddMenuItem(
$"↳ 思考模式: {currentThinking} → 高",
"🧠",
$"session-thinking|high|{session.Key}",
indent: true);
menu.AddMenuItem(
$"↳ 详细模式: {currentVerbose} → {nextVerbose}",
"📝",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| | `NotifyStock` | bool | `true` | 显示库存警报 | | ||
| | `NotifyInfo` | bool | `true` | 显示一般信息通知 | | ||
| | `NotifyChatResponses` | bool | `true` | 显示聊天响应 toasts | | ||
| | `PreferStructuredCategories` | bool | `true` | 使用网关元数据而非关键词 | |
| _ => "⚪" | ||
| }; | ||
| menu.AddMenuItem($"Status: {_currentStatus}", statusIcon, "status"); | ||
| menu.AddMenuItem($"状态: {_currentStatus}", statusIcon, "status"); |
| /// <summary> | ||
| /// First-run welcome dialog for new users. | ||
| /// 首次运行欢迎对话框,用于新用户。 | ||
| /// </summary> |
| <ComboBox x:Name="NotificationSoundComboBox" Header="声音" Width="200"> | ||
| <ComboBoxItem Content="默认"/> | ||
| <ComboBoxItem Content="无"/> | ||
| <ComboBoxItem Content="轻微"/> |
| <TextBox x:Name="TokenTextBox" Header="令牌" | ||
| PlaceholderText="你的 API 令牌" Width="300"/> | ||
| <Button x:Name="TestConnectionButton" Content="测试" | ||
| VerticalAlignment="Bottom" Click="OnTestConnection"/> | ||
| </StackPanel> | ||
|
|
||
| <TextBlock x:Name="StatusLabel" Style="{StaticResource CaptionTextBlockStyle}" | ||
| Foreground="{ThemeResource TextFillColorSecondaryBrush}"/> |
| <TextBlock x:Name="StatusText" Text="已连接" | ||
| Style="{StaticResource SubtitleTextBlockStyle}"/> | ||
| <TextBlock x:Name="LastCheckText" Text="Last check: --" | ||
| <TextBlock x:Name="LastCheckText" Text="最后检查:--" | ||
| Style="{StaticResource CaptionTextBlockStyle}" |
| - 🌐 **Web 聊天** - 嵌入式 WebView2 聊天窗口 | ||
| - 📊 **实时状态** - 实时显示会话、频道和使用情况 | ||
| - ⚡ **活动流** - 专用于实时会话、使用情况、节点和通知事件的飞出面板 | ||
| - 🔔 **Toast 通知** - 带有[智能分类](docs/NOTIFICATION_CATEGORIZATION.md)的可点击 Windows 通知 |
…lback, localize on/off display strings
|
Hi! I have addressed all the review comments:
Please take another look, thanks! |
|
@Kobe9312 — Thank you for this contribution and for taking the time to translate everything into Chinese! We genuinely appreciate the effort, and your translation work is not wasted — we want to use it. However, after reviewing this PR carefully, we've decided we need to set up proper localization infrastructure before we can accept language-specific changes. The current approach of replacing English strings directly in source code has some fundamental issues:
What we're going to do insteadWe're going to implement proper WinUI localization using .resw resource files (Option A / Microsoft's recommended approach):
This means any language in the world can be added just by contributing a new How you can helpOnce we have the infrastructure PR merged (we'll file a tracking issue), we'd love your help creating the We're going to close this PR for now, but please don't feel discouraged. We'll tag you on the localization infrastructure issue so you can jump in with the Chinese resource file as soon as it's ready. Thank you again! 🙏 |