feat: add translation for "1 hour ago" in multiple languages (#1096)

This commit is contained in:
Asurada 2025-03-14 16:57:03 +08:00 committed by GitHub
parent c3e1fb93b6
commit db504241ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 13 additions and 1 deletions

View file

@ -129,7 +129,10 @@ namespace SourceGit.Views
return App.Text("Period.MinutesAgo", (int)span.TotalMinutes);
if (span.TotalDays < 1)
return App.Text("Period.HoursAgo", (int)span.TotalHours);
{
var hours = (int)span.TotalHours;
return hours == 1 ? App.Text("Period.HourAgo") : App.Text("Period.HoursAgo", hours);
}
var lastDay = now.AddDays(-1).Date;
if (localTime >= lastDay)