Some changes for the notification layout & localize timestamps

This commit is contained in:
notiant
2025-11-23 00:51:04 +01:00
committed by GitHub
parent 1ff64efc64
commit e34248d5cb
14 changed files with 135 additions and 22 deletions

View File

@@ -504,7 +504,7 @@
"password": "Passwort eingeben...",
"restart": "Neu starten",
"shut-down": "Herunterfahren",
"suspend": "Ruhezustand",
"suspend": "Energie sparen",
"welcome-back": "Willkommen zurück,"
},
"notifications": {
@@ -513,6 +513,15 @@
"description": "Ihre Benachrichtigungen werden hier angezeigt, sobald sie eintreffen.",
"no-notifications": "Keine Benachrichtigungen",
"title": "Benachrichtigungen"
},
"time": {
"now": "jetzt",
"diffM": "vor 1 Minute",
"diffMM": "vor {diff} Minuten",
"diffH": "vor 1 Stunde",
"diffHH": "vor {diff} Stunden",
"diffD": "vor 1 Tag",
"diffDD": "vor {diff} Tagen"
}
},
"options": {
@@ -763,11 +772,11 @@
"action-in-seconds": "{action} in {seconds} Sekunden...",
"hibernate": "Ruhezustand",
"lock": "Sperren",
"lock-and-suspend": "Sperren und Ruhezustand",
"lock-and-suspend": "Sperren und Energie sparen",
"logout": "Abmelden",
"reboot": "Neu starten",
"shutdown": "Herunterfahren",
"suspend": "Energiesparmodus",
"suspend": "Energie sparen",
"title": "Sitzungsmenü"
},
"settings": {
@@ -1521,8 +1530,8 @@
"label": "Kompakter Sperrbildschirm"
},
"lock-on-suspend": {
"description": "Den Bildschirm beim Suspendieren des Systems automatisch sperren.",
"label": "Sperren beim Ruhezustand"
"description": "Den Bildschirm beim Energiesparen automatisch sperren.",
"label": "Sperren beim Energiesparen"
},
"show-hibernate": {
"description": "Die Option 'Ruhezustand' in den Energieaktionen anzeigen.",

View File

@@ -513,6 +513,15 @@
"description": "Your notifications will show up here as they arrive.",
"no-notifications": "No notifications",
"title": "Notifications"
},
"time": {
"now": "now",
"diffM": "1 minute ago",
"diffMM": "{diff} minutes ago",
"diffH": "1 hour ago",
"diffHH": "{diff} hours ago",
"diffD": "1 day ago",
"diffDD": "{diff} days ago"
}
},
"options": {

View File

@@ -513,6 +513,15 @@
"description": "Tus notificaciones aparecerán aquí a medida que lleguen.",
"no-notifications": "No hay notificaciones",
"title": "Notificaciones"
},
"time": {
"now": "ahora",
"diffM": "hace 1 minuto",
"diffMM": "hace {diff} minutos",
"diffH": "hace 1 hora",
"diffHH": "hace {diff} horas",
"diffD": "hace 1 día",
"diffDD": "hace {diff} días"
}
},
"options": {

View File

@@ -513,6 +513,15 @@
"description": "Vos notifications apparaîtront ici à mesure qu'elles arriveront.",
"no-notifications": "Aucune notification",
"title": "Notifications"
},
"time": {
"now": "maintenant",
"diffM": "il y a 1 minute",
"diffMM": "il y a {diff} minutes",
"diffH": "il y a 1 heure",
"diffHH": "il y a {diff} heures",
"diffD": "il y a 1 jour",
"diffDD": "il y a {diff} jours"
}
},
"options": {

View File

@@ -513,6 +513,15 @@
"description": "Je meldingen verschijnen hier zodra ze binnenkomen.",
"no-notifications": "Geen meldingen",
"title": "Meldingen"
},
"time": {
"now": "nu",
"diffM": "1 minuut geleden",
"diffMM": "{diff} minuten geleden",
"diffH": "1 uur geleden",
"diffHH": "{diff} uur geleden",
"diffD": "1 dag geleden",
"diffDD": "{diff} dagen geleden"
}
},
"options": {

View File

@@ -513,6 +513,15 @@
"description": "Suas notificações aparecerão aqui assim que chegarem.",
"no-notifications": "Nenhuma notificação",
"title": "Notificações"
},
"time": {
"now": "agora",
"diffM": "há 1 minuto",
"diffMM": "há {diff} minutos",
"diffH": "há 1 hora",
"diffHH": "há {diff} horas",
"diffD": "há 1 dia",
"diffDD": "há {diff} dias"
}
},
"options": {

View File

@@ -513,6 +513,15 @@
"description": "Ваши уведомления будут появляться здесь по мере их поступления.",
"no-notifications": "Нет уведомлений",
"title": "Уведомления"
},
"time": {
"now": "сейчас",
"diffM": "1 минуту назад",
"diffMM": "{diff} минут назад",
"diffH": "1 час назад",
"diffHH": "{diff} часов назад",
"diffD": "1 день назад",
"diffDD": "{diff} дней назад"
}
},
"options": {

View File

@@ -513,6 +513,15 @@
"description": "Bildirimler geldikçe burada görünecek.",
"no-notifications": "Bildirim yok",
"title": "Bildirimler"
},
"time": {
"now": "şimdi",
"diffM": "1 dakika önce",
"diffMM": "{diff} dakika önce",
"diffH": "1 saat önce",
"diffHH": "{diff} saat önce",
"diffD": "1 gün önce",
"diffDD": "{diff} gün önce"
}
},
"options": {

View File

@@ -513,6 +513,15 @@
"description": "Ваші сповіщення з'являтимуться тут по мірі надходження.",
"no-notifications": "Немає сповіщень",
"title": "Сповіщення"
},
"time": {
"now": "зараз",
"diffM": "1 хвилину тому",
"diffMM": "{diff} хвилин тому",
"diffH": "1 годину тому",
"diffHH": "{diff} годин тому",
"diffD": "1 день тому",
"diffDD": "{diff} днів тому"
}
},
"options": {

View File

@@ -513,6 +513,15 @@
"description": "您的通知将在到达时显示在此处。",
"no-notifications": "无通知",
"title": "通知"
},
"time": {
"now": "现在",
"diffM": "1 分钟前",
"diffMM": "{diff} 分钟前",
"diffH": "1 小时前",
"diffHH": "{diff} 小时前",
"diffD": "1 天前",
"diffDD": "{diff} 天前"
}
},
"options": {

View File

@@ -100,11 +100,23 @@ Singleton {
return "";
const diff = Date.now() - date.getTime();
if (diff < 60000)
return "now";
return I18n.tr("notifications.time.now");
if (diff < 120000)
return I18n.tr("notifications.time.diffM");
if (diff < 3600000)
return `${Math.floor(diff / 60000)}m ago`;
return I18n.tr("notifications.time.diffMM", {
"diff": Math.floor(diff / 60000)
});
if (diff < 7200000)
return I18n.tr("notifications.time.diffH");
if (diff < 86400000)
return `${Math.floor(diff / 3600000)}h ago`;
return `${Math.floor(diff / 86400000)}d ago`;
return I18n.tr("notifications.time.diffHH", {
"diff": Math.floor(diff / 3600000)
});
if (diff < 172800000)
return I18n.tr("notifications.time.diffD");
return I18n.tr("notifications.time.diffDD", {
"diff": Math.floor(diff / 86400000)
});
}
}

View File

@@ -393,23 +393,22 @@ Variants {
RowLayout {
Layout.fillWidth: true
spacing: Style.marginL
Layout.margins: Style.marginM
Layout.leftMargin: Style.marginM * 2
Layout.rightMargin: Style.marginM * 2
Layout.topMargin: Style.marginM
Layout.bottomMargin: Style.marginM
ColumnLayout {
NImageCircled {
Layout.preferredWidth: Math.round(40 * Style.uiScaleRatio)
Layout.preferredHeight: Math.round(40 * Style.uiScaleRatio)
Layout.alignment: Qt.AlignTop
Layout.topMargin: 30
Layout.alignment: Qt.AlignVCenter
imagePath: model.originalImage || ""
borderColor: Color.transparent
borderWidth: 0
fallbackIcon: "bell"
fallbackIconSize: 24
}
Item {
Layout.fillHeight: true
}
}
ColumnLayout {
@@ -430,9 +429,18 @@ Variants {
}
NText {
text: `${model.appName || I18n.tr("system.unknown-app")} · ${Time.formatRelativeTime(model.timestamp)}`
color: Color.mSecondary
text: model.appName || "Unknown App"
pointSize: Style.fontSizeXS
font.weight: Style.fontWeightBold
color: Color.mSecondary
}
NText {
textFormat: Text.PlainText
text: " " + Time.formatRelativeTime(model.timestamp)
pointSize: Style.fontSizeXXS
color: Color.mOnSurfaceVariant
anchors.bottom: parent.bottom
}
Item {

View File

@@ -238,13 +238,16 @@ SmartPanel {
NText {
text: model.appName || "Unknown App"
pointSize: Style.fontSizeXS
font.weight: Style.fontWeightBold
color: Color.mSecondary
}
NText {
text: Time.formatRelativeTime(model.timestamp)
pointSize: Style.fontSizeXS
color: Color.mSecondary
textFormat: Text.PlainText
text: " " + Time.formatRelativeTime(model.timestamp)
pointSize: Style.fontSizeXXS
color: Color.mOnSurfaceVariant
anchors.bottom: parent.bottom
}
}

View File

@@ -100,9 +100,9 @@ Item {
anchors.bottom: parent.bottom
anchors.bottomMargin: Style.marginM
anchors.left: parent.left
anchors.leftMargin: Style.marginM * 2
anchors.leftMargin: Style.marginM * 3
anchors.right: parent.right
anchors.rightMargin: Style.marginM * 2
anchors.rightMargin: Style.marginM * 3
spacing: Style.marginL
// Icon