Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 158
  • Last Modified:

RETRIEVE COUNTRY CODES FROM WINDOWS

Hi All,

Does anyone know how I can retrieve the official Windows language codes like BE, NL, ...... and so on.
I don't think this is hard to do.

Tom.
0
TomDedecker
Asked:
TomDedecker
1 Solution
 
geobulCommented:
Hi,

Language codes are three letters long. Place one ListBox and one Button on a form and try this:

// to get a list of all supported languages
procedure TForm1.Button1Click(Sender: TObject);
var
  i: integer;
begin
  ListBox1.Items.Clear;
  for i := 0 to Languages.Count - 1 do ListBox1.Items.Add(Languages.Ext[i]);
end;

// to get the current locale (returns 'ENU' on my computer):
function GetLocaleCode: string;
begin
  result := Languages.Ext[Languages.IndexOf(SysLocale.DefaultLCID)];
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  ShowMessage(GetLocaleCode);
end;

Regards, Geo
0
 
SpideyModCommented:
Please return to this question and finalize.

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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