microsoft / microsoft/microsoft-ui-xaml

Unpackage apps ToggleSwitch's On/Off Content can't change by PrimaryLanguageOverride

Open
#10,430 6 comments 1 reaction 0 assignees View on GitHub
area-ToggleSwitch bug group-language team-Controls
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

As the title says. In unpackage apps, I try to set PrimaryLanguageOverride. Then the language in the application has changed, but the On/Off Content of ToggleSwitch is still the system language, not the corresponding language of PrimaryLanguageOverride. This will not happen in Package apps.

### Steps to reproduce the bug

1. Set your system language to non-English. Such as Chinese, French, Japanese, etc.
2. In App.xaml.cs, `Microsoft.Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "en-us"`
3. Run application as Unpackage

### Expected behavior

You will see, ToggleSwitch's On/Off Content text will be your system language.If you run application as Package, the text will be displayed correctly in English.

### Screenshots

Unpackage:

![Unpackage](https://github.com/user-attachments/assets/2fd6cd20-df9d-4cfb-9df5-12b8b09382b6)

Package:

![Package](https://github.com/user-attachments/assets/c01219aa-845f-4242-bcb5-b8fbfa87ae6a)

### NuGet package version

WinUI 3 - Windows App SDK 1.6.6: 1.6.250228001

### Windows version

Windows 11 (23H2): Build 22631

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue from App.xaml.cs using PrimaryLanguageOverride with a non-English system language, comparing packaged and unpackaged runs on Windows App SDK 1.6.6. Start by tracing ToggleSwitch's On/Off content localization and the package-mode difference. Done means the unpackaged ToggleSwitch displays the override language consistently with the packaged app.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, internationalization, localization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.