unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 =
class(TForm)
LabeledEdit1: TLabeledEdit;
LabeledEdit2: TLabeledEdit;
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
bla:
array[0..1023]
of Char;
implementation
{$R *.dfm}
function GetLanguageNameByID(AID: Integer): WideString;
begin
SetLength(Result,MAX_PATH);
SetLength(Result, VerLanguageNameW(AID,@Result[1], length(Result)));
end;
function GetWindowsLanguage(LCTYPE: LCTYPE
{type of information}):
string;
var
Buffer : PChar;
Size : integer;
begin
Size := GetLocaleInfo (LOCALE_USER_DEFAULT, LCType,
nil, 0);
GetMem(Buffer, Size);
try
GetLocaleInfo (LOCALE_USER_DEFAULT, LCTYPE, Buffer, Size);
Result :=
string(Buffer);
finally
FreeMem(Buffer);
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
LabeledEdit1.Text := GetLanguageNameByID(GetSystemDefaultLangID);
//Deutsch (Deutschland)
LabeledEdit2.Text := GetLanguageNameByID(GetUserDefaultLangID);
//Englisch (USA)
GetLocaleInfo(GetSystemDefaultLCID, LOCALE_SENGCOUNTRY, @bla, sizeof(bla));
Memo1.Lines.Add('
Name des Landes (Englisch) : '+bla);
GetLocaleInfo(GetSystemDefaultLCID, LOCALE_SENGLANGUAGE, @bla, sizeof(bla));
Memo1.Lines.Add('
Name der Sprache auf Englisch: '+bla);
GetLocaleInfo(GetSystemDefaultLCID, LOCALE_SLANGUAGE, @bla, sizeof(bla));
Memo1.Lines.Add('
Name der Sprache lokalisiert : '+bla);
GetLocaleInfo(GetSystemDefaultLCID, LOCALE_SNATIVELANGNAME, @bla, sizeof(bla));
Memo1.Lines.Add('
Orginalname der Sprache : '+bla);
GetLocaleInfo(GetSystemDefaultLCID, LOCALE_SNATIVECTRYNAME , @bla, sizeof(bla));
Memo1.Lines.Add('
Orginalname des Landes : '+bla);
Memo1.Lines.Add('
');
Memo1.Lines.Add(GetWindowsLanguage(LOCALE_ILANGUAGE));
Memo1.Lines.Add(GetWindowsLanguage(LOCALE_SLANGUAGE));
Memo1.Lines.Add(GetWindowsLanguage(LOCALE_SENGLANGUAGE));
Memo1.Lines.Add(GetWindowsLanguage(LOCALE_SABBREVLANGNAME));
Memo1.Lines.Add(GetWindowsLanguage(LOCALE_SNATIVELANGNAME));
end;
end.