Skip to content

Add Simplified Chinese localization and language settings - #6

Open
Jill-Stingray-L wants to merge 1 commit into
ognjeeen:masterfrom
Jill-Stingray-L:feat/zh-cn-localization
Open

Add Simplified Chinese localization and language settings#6
Jill-Stingray-L wants to merge 1 commit into
ognjeeen:masterfrom
Jill-Stingray-L:feat/zh-cn-localization

Conversation

@Jill-Stingray-L

@Jill-Stingray-L Jill-Stingray-L commented Aug 30, 2026

Copy link
Copy Markdown

Summary

  • extract user-facing text into standard .NET localization resources
  • add complete Simplified Chinese (zh-CN) resources with English fallback
  • detect the Windows UI language and support System, English, and Simplified Chinese preferences
  • persist manual language overrides in Settings
  • refresh the widget, Settings, tray, taskbar, activity-hook, tooltip, accessibility, status, error, and update UI at runtime
  • keep existing numeric and date formatting semantics unchanged
  • add resource parity, culture resolution, persistence, runtime switching, and regression tests

No third-party localization dependencies were added.

image image image

Testing

  • dotnet restore .\CodexUsageWidget.slnx
  • dotnet build .\CodexUsageWidget.slnx -c Release --no-restore
  • dotnet test .\CodexUsageWidget.slnx -c Release --no-build (157 tests passed)
  • manually verified English, Simplified Chinese, runtime switching, persistence, and Windows UI layout

Closes #4

@Jill-Stingray-L

Copy link
Copy Markdown
Author

Oh, by the way, would you be open to a separate follow-up PR adding a Simplified Chinese README as README.zh-CN.md? I’d keep it outside this PR so the current localization changes remain focused.

@ognjeeen

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e65a95e568

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +49 to +50
CultureInfo.CurrentUICulture = culture;
CultureInfo.DefaultThreadCurrentUICulture = culture;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Apply the selected culture to formatted values

When an en-US user selects Simplified Chinese, or a zh-CN user selects English, this updates only CurrentUICulture; visible values are still formatted with CultureInfo.CurrentCulture in UsageTextFormatter, TokenActivityViewModel, UsageWidgetViewModel, and TaskbarLabelWindow. Consequently, day and month names remain in the Windows regional language (for example, an English Sunday, August 30 inside the Chinese UI), contradicting the explicit “always use” language setting. Also update the formatting culture/default, or format these values using Strings.Current.Culture.

Useful? React with 👍 / 👎.

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.

Proposal: Add Simplified Chinese (zh-CN) localization

2 participants