Some Windows computers have multiple display languages installed.
I can get the current user's UI language in that language using the function:
function GetUsersWindowsLanguage: string;
var
WinLanguage: array [0..50] of char;
begin
VerLanguageName(GetUserDefaultUILanguage, WinLanguage, 50);
Result := WinLanguage;
end;
This function outputs something like this:
Espagnol (Espagne)
The output is not in English. All I need is "Spanish". Is there any way to get the display language in English?
I'm using Delphi 10.3.3 (VCL application).
function GetUsersWindowsLanguage: string;
var
WinLanguage: array [0..50] of char;
begin
GetLocaleInfoW(GetUserDefaultUILanguage, LOCALE_SENGLISHDISPLAYNAME, WinLanguage, 50);
Result := WinLanguage;
end;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With