microsoft / microsoft/microsoft-ui-xaml
ApplicationLanguages.Languages is not ordered according to user preference
- 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



### 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
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