English | Türkçe
Make strings, dates, numbers, bytes and lists human-readable in Delphi
| Author | DelphiFan |
| adsdelphi@gmail.com | |
| Version | 1.0.0 |
| Target | Delphi 10.3 Rio and later (VCL) |
| License | MIT |
- Relative dates:
3 hours ago,yesterday,2 days from now - String humanize:
OrderStatusCode→Order status code - Numbers to words (English / Turkish)
- Byte sizes:
1536000→1.5 MB - Lists:
A, B and C/A, B ve C - Non-visual + visual components on the DF Humanize palette
- Cultures:
hcAuto,hcEnglish,hcTurkish
- Open
Packages\DFHumanize.groupprojin Delphi. - Build DFHumanize (runtime package).
- Build dclDFHumanize (design package).
- Component → Install Packages → Add
select:Lib\Win32\Release\dclDFHumanize.bpl - (Recommended) Add to Library path:
...\DelphiHumanizer\Lib\Win32\Release
Components appear under palette group DF Humanize.
Optional demo: Demo\DFHumanizeDemo.dproj
| Component | Description |
|---|---|
TDFHumanizer |
Central culture / helpers / About |
TDFHumanizeDate |
Relative date as Text |
TDFHumanizeNumber |
Number → words / ordinal |
TDFHumanizeBytes |
File size text |
| Component | Description |
|---|---|
TDFHumanizeLabel |
Label with auto-refresh (dates) |
TDFHumanizeStatusPanel |
Status strip: Last update: 12 minutes ago |
uses
System.SysUtils,
System.DateUtils,
DFHumanize,
DFHumanize.Types;// English
ShowMessage(Humanize.DateTime(IncHour(Now, -3), hcEnglish));
// -> 3 hours ago
ShowMessage(Humanize.DateTime(IncDay(Now, 1), hcEnglish));
// -> tomorrow
// Turkish
ShowMessage(Humanize.DateTime(IncHour(Now, -3), hcTurkish));
// -> 3 saat önce
ShowMessage(Humanize.DateTime(IncDay(Now, -1), hcTurkish));
// -> dün
// Auto = OS UI language
ShowMessage(Humanize.DateTime(IncMinute(Now, -12), hcAuto));ShowMessage(Humanize.StringValue('OrderStatusCode'));
// -> Order status code
ShowMessage(Humanize.StringValue('dash-separated-name', lcTitleCase));
// -> Dash Separated Name
ShowMessage(Humanize.Dehumanize('order status code'));
// -> OrderStatusCode
ShowMessage(Humanize.Truncate('Long text to truncate', 10));
// -> Long text…ShowMessage(Humanize.Number(1234, hcEnglish));
// -> one thousand two hundred thirty-four
ShowMessage(Humanize.Number(1234, hcTurkish));
// -> bin iki yüz otuz dört
ShowMessage(Humanize.Ordinal(21, hcEnglish));
// -> 21st
ShowMessage(Humanize.Ordinal(21, hcTurkish));
// -> 21.
ShowMessage(Humanize.Quantity(3, 'file', 'files', hcEnglish));
// -> 3 files
ShowMessage(Humanize.Quantity(3, 'dosya', '', hcTurkish));
// -> 3 dosyaShowMessage(Humanize.Bytes(1536000));
// -> 1.5 MB
ShowMessage(Humanize.List(['Ankara', 'Izmir', 'Bursa'], hcEnglish));
// -> Ankara, Izmir and Bursa
ShowMessage(Humanize.List(['Ankara', 'Izmir', 'Bursa'], hcTurkish));
// -> Ankara, Izmir ve BursaShowMessage(Humanize.Version);
// -> 1.0.0
ShowMessage(Humanize.AboutText);
// -> DFHumanize 1.0.0 - DelphiFan <adsdelphi@gmail.com> - https://delphifan.comDelphiHumanizer/
Source/ Core units + components
Packages/ Runtime + design packages (.groupproj)
Demo/ VCL sample application
Lib/ Build output (BPL / DCP / DCU)
README.md
README.tr.md
LICENSE
- Embarcadero Delphi 10.3 Rio or newer
- VCL (Win32 design package)
MIT — see LICENSE.
Copyright (c) DelphiFan — delphifan.com — adsdelphi@gmail.com