microsoft / microsoft/microsoft-ui-xaml

ApplicationLanguages.Languages is not ordered according to user preference

Open
#10,075 1 comment 1 reaction 0 assignees View on GitHub
bug needs-triage
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

The documentation states that the Languages list is a list of appropriate languages, ranked in order of preference.
The list of languages is filtered from the ManifestLanguages list, but it is not ordered according to preference (as set in Windows Setting Language)

I have set my Windows station to Swedish, only adding sv-SE as language, and yet my Languages list will have en-US as the first entry, and sv-SE as second.

This also affects the primary display language of the application, which in my case will be English if I don't explicitly set the PrimaryLanguageOverride property.

### Steps to reproduce the bug

Create a project with multiple resource files
Change the order of preferred language (Windows Settings > Time & language > Language & region).
The order of the Languages list remains the same
Restarting the computer does not affect this behavior

### Expected behavior

The order of items should match the preferred selection in Windows

### Screenshots

![Image](https://github.com/user-attachments/assets/afa3d540-eb49-491c-8149-45b313f09fc5)
![Image](https://github.com/user-attachments/assets/eac4e26f-e05d-4008-8e7d-e6e3c3a41822)
![Image](https://github.com/user-attachments/assets/9e6b8e58-f5f3-40ba-94c4-4b57b764d196)

### NuGet package version

WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002

### Windows version

Windows 11 (22H2): Build 22621

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with multiple resource files and changing the preferred language order in Windows Settings, then inspect ApplicationLanguages.Languages and ManifestLanguages behavior. Done means Languages follows the Windows preference order and the primary display language reflects that order without an explicit override.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, internationalization
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.