Implement English language support#28
Merged
Merged
Conversation
Lays groundwork for runtime UI localization. WinAppSDK requires a process restart to apply a new PrimaryLanguageOverride, so the flow is "change in Personalize, restart to see effect". - LanguageHelper: single (Tag?, DisplayName) table. Index 0 is "follow system" (Tag=null -> no override -> WinAppSDK uses the OS locale, then the <DefaultLanguage>en-US</DefaultLanguage> fallback in csproj). - ApplyPersistedLanguageOverride: JsonDocument-parses settings.json before InitializeComponent, avoiding the impossible read of PrimaryLanguageOverride in unpackaged apps. - App.Restart: AppInstance.Restart + manual fallback after cleanup, necessary because xray.exe is not in our job object. - Personalize ComboBox: data-driven (ItemsSource + DataTemplate); adding a language is a one-line edit in LanguageHelper. - Restart InfoBar tracks divergence from the loaded value -- flipping back to the initial choice clears it. - Done command persists Language too (parity with Theme / Backdrop). UI text remains hardcoded Chinese -- extraction lands in a later commit. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… versions Switching from "2.0.*" to exact pins (2.0.185 / 2.0.300) eliminates an intermittent restore-time conflict where the floating versions could transitively pull in Foundation 2.0.21 / InteractiveExperiences 2.0.13, mismatching Microsoft.WindowsAppSDK 2.0.1's expected 2.0.20 / 2.0.12. Bump deliberately when WindowsAppSDK itself is upgraded. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ay strings Mode state and persistence now use stable codes; display goes through a derived *Text getter. Same UI behavior, but the data flow stops piggybacking on translated Chinese strings -- which broke the moment i18n is introduced. - ControlPanelViewModel.RoutingMode is now "smart" | "global" (matches AppSettings.RoutingMode exactly, so the persistence layer is the identity function). Display goes through RoutingModeText. - SetProxyMode takes "system" | "manual" instead of the localized labels. - XAML RadioMenuFlyoutItem.CommandParameter switched to the business codes; the status-bar and mini-view TextBlocks now bind RoutingModeText. - Drops the noise three-way in MainViewModel.InitializeAsync that mapped business codes to business codes through Chinese labels. The Chinese in RoutingModeText / MenuFlyoutItem.Text stays for now -- it's display text, not a code. String extraction lands in the next commit. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Wires the runtime localization from commit 1 through the highest-traffic surfaces. ServerList, ServerDetail, MainWindow chrome and assorted minor dialogs are still hardcoded Chinese and land in a follow-up. - L.cs grows into a strongly-typed accessor for ~80 keys grouped by surface (dialog buttons, edit-server fields, error / startup / update / DNS / chain proxy / preset-replace dialogs, control panel state). - DialogService: every dialog now reads from L.* / Loc.Format. The ShowConfirmationAsync default args (which can't be properties) switch to nullable + ??= fallback inside the method body; IDialogService matches. - ControlPanelViewModel state strings (Start/Stop button, StatusText, RoutingModeText, error and update flows) go through L.*; UpdateMenuText uses Loc.Format. MainViewModel.ActiveServerName / MiniStatusText too. - ControlPanelControl.xaml gains x:Uid on every MenuFlyoutItem / Routing / TUN label so PRI injects the localized .Text at build time; the original Chinese stays as design-time fallback. - resw files: ~280 keys. New ChainProxy / DNS / preset-replace keys cover surfaces the original i18n stash never touched. Debug.WriteLine and internal-only strings stay Chinese on purpose -- they're developer-facing. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Covers the second wave of i18n work — the main user surface and the secondary dialogs. Static XAML labels move to x:Uid + .Text/.Content resw entries; attached properties (AutomationProperties.Name, ToolTipService.ToolTip) and Window.Title get wired up via code-behind because x:Uid is awkward for those. Files touched: - ServerList / ServerDetail (controls + view models) - MainWindow (title bar + tray menu) - LogWindow (toolbar + status + privacy dialog) - CustomRulesWindow + CustomRulesViewModel + AddRuleDialog - PersonalizeControl remaining labels + import/export feedback - AddChainProxyDialog, TunConfirmationDialog, ManageSubscriptionsDialog - SubscriptionEntry.LastUpdatedText relative-time strings - UpdateService progress + exception messages (surface in dialogs) - ControlPanelControl Personalize tooltip Out of scope (Chinese strings deliberately preserved): - Debug.WriteLine / dev logs in XrayService / TunService / SystemProxyService / ControlPanelViewModel - LanguageHelper.SupportedLanguages DisplayName (endonym convention) zh-CN/Resources.resw diff is inflated by the .NET ResX writer reformatting compact <data> entries to the standard multi-line shape; content is preserved. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b25fbfe7db
ℹ️ 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".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Strings/en-USandStrings/zh-CN.