In the "language settings" control panel in Windows 10 (and older versions -- this appears to have been introduced in Win8?) there is a list of "Preferred Languages". What is the correct way to programmatically obtain that list?
I can see it stored in the registry at HKEY_CURRENT_USER\Control Panel\International\User Profile\Languages
, but I assume that it is not intended that this be read directly.
I found an API GetUserPreferredUILanguages
that sounds like the right thing -- but it returns the wrong results.
Specifically, in the control panel and registry key I currently have the list en-NZ en-US it-IT
, but the API returns en-GB
en-US
. I have no idea where it's getting that from. (Or why Italian is missing.)
The GetUserDefaultLocaleName
API does correctly return en-NZ
, but it also seems to be getting that from somewhere else -- when I rearrange the language list in the control panel, the registry updates but the API return value doesn't change.
I do want the full list of languages, not just a single answer. (Also, out of curiosity, which control panel is the API getting its answers from?)