Skip to content

Localize literal strings#10

Merged
SadPencil merged 13 commits intomasterfrom
copilot/localize-mainwindow-xaml
Mar 15, 2026
Merged

Localize literal strings#10
SadPencil merged 13 commits intomasterfrom
copilot/localize-mainwindow-xaml

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 15, 2026

Two hardcoded Chinese strings in MainWindow.xaml — the GitHub button label and the messages count suffix — were not yet localized. Also switches TextResource code generation to public so the resource class can be referenced directly from XAML via {x:Static}.

Changes

  • Mo3RegUI.csproj: ResXFileCodeGeneratorPublicResXFileCodeGenerator to expose TextResource as a public class
  • TextResource.resx / TextResource.zh-Hans.resx: Added two new keys:
    • MainWindow_GitHubUrlButton — "View on GitHub" / "在 GitHub 上查看"
    • MainWindow_MessagesCount — " messages" / " 条消息"
  • MainWindow.xaml: Added xmlns:l10n namespace alias; replaced both Chinese literals with {x:Static} bindings:
xmlns:l10n="clr-namespace:Mo3RegUI.LocalizationResources"

<!-- GitHub button -->
<Label Margin="0" Content="{x:Static l10n:TextResource.MainWindow_GitHubUrlButton}"/>

<!-- Messages count suffix -->
<TextBlock Text="{x:Static l10n:TextResource.MainWindow_MessagesCount}" ... />

TextResource.Designer.cs regeneration (to pick up the public modifier and the two new properties) is left to the repository owner.


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Co-authored-by: SadPencil <11227602+SadPencil@users.noreply.github.com>
Copilot AI changed the title [WIP] Localize strings in MainWindow.xaml.cs for localization Localize Chinese strings in MainWindow.xaml.cs Mar 15, 2026
Copilot AI requested a review from SadPencil March 15, 2026 17:04
Co-authored-by: SadPencil <11227602+SadPencil@users.noreply.github.com>
Copilot AI changed the title Localize Chinese strings in MainWindow.xaml.cs Localize all Chinese strings in Tasks/*.cs Mar 15, 2026
…Resource.*}

Co-authored-by: SadPencil <11227602+SadPencil@users.noreply.github.com>
Copilot AI changed the title Localize all Chinese strings in Tasks/*.cs Localize remaining Chinese strings in MainWindow.xaml Mar 15, 2026
@SadPencil SadPencil changed the title Localize remaining Chinese strings in MainWindow.xaml Localize literal strings Mar 15, 2026
@SadPencil SadPencil marked this pull request as ready for review March 15, 2026 22:04
@SadPencil SadPencil merged commit 402e987 into master Mar 15, 2026
1 check failed
@SadPencil SadPencil deleted the copilot/localize-mainwindow-xaml branch March 15, 2026 22:07
SadPencil added a commit that referenced this pull request Mar 15, 2026
Co-authored-by: SadPencil <sadpencil@outlook.com>
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