• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 182
  • Last Modified:

Regional and Language Options

Hello,

How could I get the Language of the PC like this,

English PC, Return "UK"
English PC (US), Return "US"
French PC, Return "FR"
etc...

Thanks.
0
-Karamja-
Asked:
-Karamja-
1 Solution
 
geobulCommented:
Hi,

Try this one:

function GetUserLangID: string;
var
  i: integer;
  wlcid: LCID;
begin
  result := '';
  wlcid := GetUserDefaultLCID; // or use GetSystemDefaultLCID; for default system language
  for i := 0 to Languages.Count - 1 do
    if Languages.LocaleID[i] = wlcid then result := Languages.Ext[i];
end;

It returns the three letter ID (not two). Perhaps there is a better way.

Regards, Geo
0
 
-Karamja-Author Commented:
Thank you. :)
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now