(CodeLib-Manager)
Registriert seit: 10. Jun 2002
4.648 Beiträge
Delphi XE Professional
|
Re: Sprache abfragen
20. Mai 2004, 17:30
Habe auch noch eine Funktion für GetLocaleInfo geschrieben:
(Evtl für die Code-Lib)
Delphi-Quellcode:
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.Button1Click(Sender: TObject);
begin
Caption := GetWindowsLanguage(LOCALE_SABBREVLANGNAME);
(*
LOCALE_ILANGUAGE { language id }
LOCALE_SLANGUAGE { localized name of language }
LOCALE_SENGLANGUAGE { English name of language }
LOCALE_SABBREVLANGNAME { abbreviated language name }
LOCALE_SNATIVELANGNAME { native name of language }
*)
end;
Thomas
|
|
Zitat
|