function GetLocaleStr(const Locale, LCType: Cardinal): ShortString;
begin
Result[0] := Char(GetLocaleInfo(Locale, LCType, @Result[1], 255) - 1);
Result[1] := Char(Byte(Result[1]) and not $20);
end;
function GetDateStr(DateTime: TDateTime; Lang: Cardinal): string;
var SystemTime: TSystemTime; Locale, LCID: Cardinal;
begin
LCID := GetThreadLocale;
SetThreadLocale(Lang);
Locale := GetThreadLocale;
DateTimeToSystemTime(DateTime, SystemTime);
Result := GetLocaleStr(Locale, LOCALE_SDAYNAME1 + Word(SystemTime.wDayOfWeek - 1) mod $FFF9) + ', ' + IntToStr(SystemTime.wDay) + ' de ' +
GetLocaleStr(Locale, LOCALE_SMONTHNAME1 + SystemTime.wMonth - 1) + ' del ' + IntToStr(SystemTime.wYear);
SetThreadLocale(LCID);
end;
procedure TForm1.FormCreate(Sender: TObject);
var xxx: string;
begin
DateTimeToString(xxx, 'dddd, d "de" mmmm "de" yyyy', Now);
Caption := xxx + ' ~ ' + GetDateStr(Now, LANG_PORTUGUESE) + ' ~ ' + GetDateStr(Now, LANG_ENGLISH) + ' ~ ' + GetDateStr(Now, LANG_SPANISH);
end;