'Windows 11 Culture and UiCulture disagree
I'm writing a UWP app that supports localization. When testing on different machines I get opposite values for Culture and UICulture.
When both machines are set in Windows 11 to be Español (Estados Unidos) and have the Windows UI in Spanish, they returns swapped results:
System.Globalization.CultureInfo.CurrentCulturereturnsen-USon one machine andes-USon another machine.System.Globalization.CultureInfo.CurrentUICulturereturnses-USon one machine anden-USon another machine.
This causes the localization not to work on the machine that returns en-US incorrectly for CurrentUICulture (i.e. it display the app in English instead of Spanish).
Interestingly enough, PowerShell returns the opposite values - Get-Culture returns the same value as CultureInfo.CurrentUICulture and Get-UICulture returns the same value as CultureInfo.CurrentCulture.
How can I get consistent behavior from Windows?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
