From e41d73eae3957f44d5e99a705cea9f7a3ee1a839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tinkl?= Date: Tue, 12 Jul 2022 10:22:53 +0200 Subject: [PATCH] fix: unbreak "fetch more messages..." leftover from the qsTrId() -> qsTr() transition; obey the locale settings a bit more --- ui/imports/shared/controls/chat/FetchMoreMessagesButton.qml | 6 +++--- ui/imports/shared/controls/chat/GapComponent.qml | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ui/imports/shared/controls/chat/FetchMoreMessagesButton.qml b/ui/imports/shared/controls/chat/FetchMoreMessagesButton.qml index 920016e417..eb47f4ee24 100644 --- a/ui/imports/shared/controls/chat/FetchMoreMessagesButton.qml +++ b/ui/imports/shared/controls/chat/FetchMoreMessagesButton.qml @@ -20,8 +20,8 @@ Item { QtObject { id: d - property string formattedDate: nextMessageIndex > -1 ? Utils.formatLongDate(nextMsgTimestamp * 1, RootStore.accountSensitiveSettings.isDDMMYYDateFormat) : - Utils.formatLongDate(undefined, RootStore.accountSensitiveSettings.isDDMMYYDateFormat) + readonly property string formattedDate: nextMessageIndex > -1 ? Utils.formatLongDate(nextMsgTimestamp * 1, RootStore.accountSensitiveSettings.isDDMMYYDateFormat) : + Utils.formatLongDate(undefined, RootStore.accountSensitiveSettings.isDDMMYYDateFormat) } Timer { @@ -80,7 +80,7 @@ Item { anchors.horizontalCenter: parent.horizontalCenter horizontalAlignment: Text.AlignHCenter color: Style.current.secondaryText - text: qsTr("before--%1").arg(d.formattedDate) + text: qsTr("Before %1").arg(d.formattedDate) visible: d.formattedDate } diff --git a/ui/imports/shared/controls/chat/GapComponent.qml b/ui/imports/shared/controls/chat/GapComponent.qml index ba27c79d68..19347f3717 100644 --- a/ui/imports/shared/controls/chat/GapComponent.qml +++ b/ui/imports/shared/controls/chat/GapComponent.qml @@ -1,6 +1,7 @@ import QtQuick 2.13 import shared 1.0 import shared.panels 1.0 +import shared.stores 1.0 import utils 1.0 Item { @@ -23,7 +24,7 @@ Item { font.weight: Font.Medium font.pixelSize: Style.current.primaryTextFontSize color: Style.current.blue - text: qsTr("fetch-messages") + text: qsTr("Fetch messages") horizontalAlignment: Text.AlignHCenter anchors.horizontalCenter: parent.horizontalCenter anchors.top: sep1.bottom @@ -45,7 +46,8 @@ Item { wrapMode: Text.WordWrap horizontalAlignment: Text.AlignHCenter color: Style.current.secondaryText - text: qsTr("between--1-and--2").arg(new Date(root.gapFrom * 1000)).arg(new Date(root.gapTo * 1000)) + text: qsTr("Between %1 and %2").arg(Utils.formatLongDate(root.gapFrom * 1000, RootStore.accountSensitiveSettings.isDDMMYYDateFormat)) + .arg(Utils.formatLongDate(root.gapTo * 1000, RootStore.accountSensitiveSettings.isDDMMYYDateFormat)) } Separator { anchors.top: fetchDate.bottom