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

@ -443,6 +443,7 @@
<x:String x:Key="Text.Paste" xml:space="preserve">Einfügen</x:String>
<x:String x:Key="Text.Period.JustNow" xml:space="preserve">Gerade eben</x:String>
<x:String x:Key="Text.Period.MinutesAgo" xml:space="preserve">Vor {0} Minuten</x:String>
<x:String x:Key="Text.Period.HourAgo" xml:space="preserve">Vor 1 Stunde</x:String>
<x:String x:Key="Text.Period.HoursAgo" xml:space="preserve">Vor {0} Stunden</x:String>
<x:String x:Key="Text.Period.Yesterday" xml:space="preserve">Gestern</x:String>
<x:String x:Key="Text.Period.DaysAgo" xml:space="preserve">Vor {0} Tagen</x:String>

View file

@ -444,6 +444,7 @@
<x:String x:Key="Text.Paste" xml:space="preserve">Paste</x:String>
<x:String x:Key="Text.Period.JustNow" xml:space="preserve">Just now</x:String>
<x:String x:Key="Text.Period.MinutesAgo" xml:space="preserve">{0} minutes ago</x:String>
<x:String x:Key="Text.Period.HourAgo" xml:space="preserve">1 hour ago</x:String>
<x:String x:Key="Text.Period.HoursAgo" xml:space="preserve">{0} hours ago</x:String>
<x:String x:Key="Text.Period.Yesterday" xml:space="preserve">Yesterday</x:String>
<x:String x:Key="Text.Period.DaysAgo" xml:space="preserve">{0} days ago</x:String>

View file

@ -447,6 +447,7 @@
<x:String x:Key="Text.Paste" xml:space="preserve">Pegar</x:String>
<x:String x:Key="Text.Period.JustNow" xml:space="preserve">Justo ahora</x:String>
<x:String x:Key="Text.Period.MinutesAgo" xml:space="preserve">Hace {0} minutos</x:String>
<x:String x:Key="Text.Period.HourAgo" xml:space="preserve">Hace 1 hora</x:String>
<x:String x:Key="Text.Period.HoursAgo" xml:space="preserve">Hace {0} horas</x:String>
<x:String x:Key="Text.Period.Yesterday" xml:space="preserve">Ayer</x:String>
<x:String x:Key="Text.Period.DaysAgo" xml:space="preserve">Hace {0} días</x:String>

View file

@ -422,6 +422,7 @@
<x:String x:Key="Text.Paste" xml:space="preserve">Coller</x:String>
<x:String x:Key="Text.Period.JustNow" xml:space="preserve">A l'instant</x:String>
<x:String x:Key="Text.Period.MinutesAgo" xml:space="preserve">il y a {0} minutes</x:String>
<x:String x:Key="Text.Period.HourAgo" xml:space="preserve">il y a 1 heure</x:String>
<x:String x:Key="Text.Period.HoursAgo" xml:space="preserve">il y a {0} heures</x:String>
<x:String x:Key="Text.Period.Yesterday" xml:space="preserve">Hier</x:String>
<x:String x:Key="Text.Period.DaysAgo" xml:space="preserve">il y a {0} jours</x:String>

View file

@ -448,6 +448,7 @@
<x:String x:Key="Text.Paste" xml:space="preserve">Incolla</x:String>
<x:String x:Key="Text.Period.JustNow" xml:space="preserve">Proprio ora</x:String>
<x:String x:Key="Text.Period.MinutesAgo" xml:space="preserve">{0} minuti fa</x:String>
<x:String x:Key="Text.Period.HourAgo" xml:space="preserve">1 ora fa</x:String>
<x:String x:Key="Text.Period.HoursAgo" xml:space="preserve">{0} ore fa</x:String>
<x:String x:Key="Text.Period.Yesterday" xml:space="preserve">Ieri</x:String>
<x:String x:Key="Text.Period.DaysAgo" xml:space="preserve">{0} giorni fa</x:String>

View file

@ -435,6 +435,7 @@
<x:String x:Key="Text.Paste" xml:space="preserve">Colar</x:String>
<x:String x:Key="Text.Period.JustNow" xml:space="preserve">Agora mesmo</x:String>
<x:String x:Key="Text.Period.MinutesAgo" xml:space="preserve">{0} minutos atrás</x:String>
<x:String x:Key="Text.Period.HourAgo" xml:space="preserve">1 hora atrás</x:String>
<x:String x:Key="Text.Period.HoursAgo" xml:space="preserve">{0} horas atrás</x:String>
<x:String x:Key="Text.Period.Yesterday" xml:space="preserve">Ontem</x:String>
<x:String x:Key="Text.Period.DaysAgo" xml:space="preserve">{0} dias atrás</x:String>

View file

@ -448,6 +448,7 @@
<x:String x:Key="Text.Paste" xml:space="preserve">Вставить</x:String>
<x:String x:Key="Text.Period.JustNow" xml:space="preserve">Сейчас</x:String>
<x:String x:Key="Text.Period.MinutesAgo" xml:space="preserve">{0} минут назад</x:String>
<x:String x:Key="Text.Period.HourAgo" xml:space="preserve">1 час назад</x:String>
<x:String x:Key="Text.Period.HoursAgo" xml:space="preserve">{0} часов назад</x:String>
<x:String x:Key="Text.Period.Yesterday" xml:space="preserve">Вчера</x:String>
<x:String x:Key="Text.Period.DaysAgo" xml:space="preserve">{0} дней назад</x:String>

View file

@ -447,6 +447,7 @@
<x:String x:Key="Text.Paste" xml:space="preserve">粘贴</x:String>
<x:String x:Key="Text.Period.JustNow" xml:space="preserve">刚刚</x:String>
<x:String x:Key="Text.Period.MinutesAgo" xml:space="preserve">{0}分钟前</x:String>
<x:String x:Key="Text.Period.HourAgo" xml:space="preserve">1小时前</x:String>
<x:String x:Key="Text.Period.HoursAgo" xml:space="preserve">{0}小时前</x:String>
<x:String x:Key="Text.Period.Yesterday" xml:space="preserve">昨天</x:String>
<x:String x:Key="Text.Period.DaysAgo" xml:space="preserve">{0}天前</x:String>

View file

@ -447,6 +447,7 @@
<x:String x:Key="Text.Paste" xml:space="preserve">貼上</x:String>
<x:String x:Key="Text.Period.JustNow" xml:space="preserve">剛剛</x:String>
<x:String x:Key="Text.Period.MinutesAgo" xml:space="preserve">{0} 分鐘前</x:String>
<x:String x:Key="Text.Period.HourAgo" xml:space="preserve">1 小時前</x:String>
<x:String x:Key="Text.Period.HoursAgo" xml:space="preserve">{0} 小時前</x:String>
<x:String x:Key="Text.Period.Yesterday" xml:space="preserve">昨天</x:String>
<x:String x:Key="Text.Period.DaysAgo" xml:space="preserve">{0} 天前</x:String>

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)