JamiStrings: cleanup of the usages of old variables

Add variables to strings to make complete sentences.

Change-Id: I669366ef6de92c3a7e49f677e88c10c59da0f92f
This commit is contained in:
pmagnier-slimani
2025-02-20 16:24:40 -05:00
parent c5e455a9de
commit 1bfacdbb76
10 changed files with 40 additions and 48 deletions

View File

@@ -93,7 +93,7 @@ Loader {
bottomPadding: 6 bottomPadding: 6
topPadding: 6 topPadding: 6
leftPadding: 10 leftPadding: 10
text: UtilsAdapter.getBestNameForUri(CurrentAccount.id, Author) + " " + JamiStrings.deletedMedia text: JamiStrings.deletedMedia.arg(UtilsAdapter.getBestNameForUri(CurrentAccount.id, Author))
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
width: Math.min((2 / 3) * parent.width, implicitWidth + 18, innerContent.width - senderMargin + 18) width: Math.min((2 / 3) * parent.width, implicitWidth + 18, innerContent.width - senderMargin + 18)

View File

@@ -44,10 +44,9 @@ BaseModalDialog {
button2.text: JamiStrings.optionCancel button2.text: JamiStrings.optionCancel
button2Role: DialogButtonBox.RejectRole button2Role: DialogButtonBox.RejectRole
button2.onClicked: close(); button2.onClicked: close()
button1.contentColorProvider: JamiTheme.deleteRedButton button1.contentColorProvider: JamiTheme.deleteRedButton
BusyIndicator { BusyIndicator {
id: busyInd id: busyInd
running: false running: false
@@ -68,7 +67,7 @@ BaseModalDialog {
id: labelDeletion id: labelDeletion
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
Layout.maximumWidth: root.width - 4*JamiTheme.preferredMarginSize Layout.maximumWidth: root.width - 4 * JamiTheme.preferredMarginSize
Layout.bottomMargin: 5 Layout.bottomMargin: 5
color: JamiTheme.textColor color: JamiTheme.textColor
@@ -238,14 +237,14 @@ BaseModalDialog {
radius: 5 radius: 5
RowLayout{ RowLayout {
id: warningLayout id: warningLayout
anchors.centerIn: parent anchors.centerIn: parent
anchors.margins: 15 anchors.margins: 15
width: parent.width width: parent.width
Image{ Image {
id: warningIcon id: warningIcon
Layout.fillWidth: true Layout.fillWidth: true
@@ -261,7 +260,7 @@ BaseModalDialog {
Layout.fillWidth: true Layout.fillWidth: true
Layout.margins: 15 Layout.margins: 15
text: JamiStrings.deleteAccountInfos text: JamiStrings.deleteAccountInfo
font.pointSize: JamiTheme.textFontSize font.pointSize: JamiTheme.textFontSize
font.kerning: true font.kerning: true

View File

@@ -59,7 +59,7 @@ BaseModalDialog {
Layout.fillWidth: true Layout.fillWidth: true
elide: Text.ElideRight elide: Text.ElideRight
text: modelData.body === "" ? JamiStrings.deletedMessage : modelData.body text: modelData.body === "" ? JamiStrings.deletedMessage.arg(UtilsAdapter.getBestNameForUri(CurrentAccount.id, modelData.author)) : modelData.body
color: JamiTheme.textColor color: JamiTheme.textColor
} }
} }

View File

@@ -152,7 +152,7 @@ Control {
text: textMetricsUsername1.elidedText text: textMetricsUsername1.elidedText
TextMetrics { TextMetrics {
id: textMetricsUsername1 id: textMetricsUsername1
text: isOutgoing ? JamiStrings.inReplyTo : UtilsAdapter.getBestNameForUri(CurrentAccount.id, Author) + JamiStrings.repliedTo text: isOutgoing ? JamiStrings.inReplyTo : JamiStrings.repliedTo.arg(UtilsAdapter.getBestNameForUri(CurrentAccount.id, Author))
elideWidth: 200 elideWidth: 200
elide: Qt.ElideMiddle elide: Qt.ElideMiddle
} }
@@ -688,7 +688,7 @@ Control {
readers: root.readers readers: root.readers
} }
Component { Component {
id: selfReadIconComp id: selfReadIconComp
Avatar { Avatar {
width: JamiTheme.avatarReadReceiptSize width: JamiTheme.avatarReadReceiptSize

View File

@@ -31,8 +31,6 @@ SBSMessageBase {
property string colorUrl: UtilsAdapter.luma(bubble.color) ? JamiTheme.chatviewLinkColorLight : JamiTheme.chatviewLinkColorDark property string colorUrl: UtilsAdapter.luma(bubble.color) ? JamiTheme.chatviewLinkColorLight : JamiTheme.chatviewLinkColorDark
property string colorText: UtilsAdapter.luma(bubble.color) ? JamiTheme.chatviewTextColorLight : JamiTheme.chatviewTextColorDark property string colorText: UtilsAdapter.luma(bubble.color) ? JamiTheme.chatviewTextColorLight : JamiTheme.chatviewTextColorDark
Connections { Connections {
target: bubble target: bubble
function onColorChanged(color) { function onColorChanged(color) {
@@ -44,7 +42,6 @@ SBSMessageBase {
} }
} }
isOutgoing: Author === CurrentAccount.uri isOutgoing: Author === CurrentAccount.uri
author: Author author: Author
readers: Readers readers: Readers
@@ -75,7 +72,7 @@ SBSMessageBase {
if (ParsedBody !== "") if (ParsedBody !== "")
return ParsedBody; return ParsedBody;
bubble.isDeleted = true; bubble.isDeleted = true;
return UtilsAdapter.getBestNameForUri(CurrentAccount.id, Author) + " " + JamiStrings.deletedMessage ; return JamiStrings.deletedMessage.arg(UtilsAdapter.getBestNameForUri(CurrentAccount.id, Author));
} }
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
@@ -103,7 +100,7 @@ SBSMessageBase {
onLinkActivated: Qt.openUrlExternally(new URL(hoveredLink)) onLinkActivated: Qt.openUrlExternally(new URL(hoveredLink))
readOnly: true readOnly: true
color: (ParsedBody !== "") ? getBaseColor() : (UtilsAdapter.luma(bubble.color) ? "white" : "dark") color: (ParsedBody !== "") ? getBaseColor() : (UtilsAdapter.luma(bubble.color) ? "white" : "dark")
opacity:(ParsedBody !== "") ? 1 : 0.5 opacity: (ParsedBody !== "") ? 1 : 0.5
function getBaseColor() { function getBaseColor() {
var baseColor; var baseColor;
@@ -136,7 +133,6 @@ SBSMessageBase {
selectOnly: parent.readOnly selectOnly: parent.readOnly
} }
}, },
Loader { Loader {
id: extraContent id: extraContent
@@ -243,7 +239,7 @@ SBSMessageBase {
] ]
opacity: 0 opacity: 0
Behavior on opacity { Behavior on opacity {
NumberAnimation { NumberAnimation {
duration: 100 duration: 100
} }

View File

@@ -16,11 +16,9 @@
*/ */
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import net.jami.Models 1.1 import net.jami.Models 1.1
import net.jami.Adapters 1.1 import net.jami.Adapters 1.1
import net.jami.Constants 1.1 import net.jami.Constants 1.1
import "../../commoncomponents" import "../../commoncomponents"
Item { Item {
@@ -35,8 +33,8 @@ Item {
function onIsRecordingRemotelyChanged() { function onIsRecordingRemotelyChanged() {
var label = ""; var label = "";
if (CurrentCall.isRecordingRemotely) { if (CurrentCall.isRecordingRemotely) {
label = CurrentCall.remoteRecorderNameList.join(", ") + " "; var names = CurrentCall.remoteRecorderNameList.join(", ");
label += (CurrentCall.remoteRecorderNameList.length > 1) ? JamiStrings.areRecording : JamiStrings.isRecording; label = (CurrentCall.remoteRecorderNameList.length > 1) ? JamiStrings.areRecording.arg(names) : JamiStrings.isRecording.arg(names);
} }
root.remoteRecordingLabel = label; root.remoteRecordingLabel = label;
} }

View File

@@ -326,7 +326,6 @@ JamiListView {
target: MessagesAdapter target: MessagesAdapter
function onCurrentConvComposingListChanged() { function onCurrentConvComposingListChanged() {
var typeIndicatorNameTextString = "";
var nameList = MessagesAdapter.currentConvComposingList; var nameList = MessagesAdapter.currentConvComposingList;
if (nameList.length > 4) { if (nameList.length > 4) {
typeIndicatorNameText.text = ""; typeIndicatorNameText.text = "";
@@ -336,19 +335,20 @@ JamiListView {
} }
if (nameList.length === 1) { if (nameList.length === 1) {
typeIndicatorNameText.text = nameList[0]; typeIndicatorNameText.text = nameList[0];
typeIndicatorEndingText.text = JamiStrings.typeIndicatorSingle.replace("{}", ""); typeIndicatorEndingText.text = JamiStrings.typeIndicatorSingle.arg("");
typeIndicatorNameText.calculateWidth(); typeIndicatorNameText.calculateWidth();
return; return;
} }
for (var i = 0; i < nameList.length; i++) { var typeIndicatorNameTextString = "";
typeIndicatorNameTextString += nameList[i]; if (nameList.length === 2) {
if (i === nameList.length - 2) typeIndicatorNameTextString = JamiStrings.typeIndicatorAnd.arg(nameList[0]).arg(nameList[1]);
typeIndicatorNameTextString += JamiStrings.typeIndicatorAnd; } else {
else if (i !== nameList.length - 1) var namesExceptLast = nameList.slice(0, -1);
typeIndicatorNameTextString += ", "; var lastName = nameList[nameList.length - 1];
typeIndicatorNameTextString = JamiStrings.typeIndicatorAnd.arg(namesExceptLast.join(", ")).arg(lastName);
} }
typeIndicatorNameText.text = typeIndicatorNameTextString; typeIndicatorNameText.text = typeIndicatorNameTextString;
typeIndicatorEndingText.text = JamiStrings.typeIndicatorPlural.replace("{}", ""); typeIndicatorEndingText.text = JamiStrings.typeIndicatorPlural.arg("");
typeIndicatorNameText.calculateWidth(); typeIndicatorNameText.calculateWidth();
} }
} }

View File

@@ -30,8 +30,8 @@ Item {
property string acceptVideo: qsTr("Accept with video") property string acceptVideo: qsTr("Accept with video")
property string refuse: qsTr("Decline") property string refuse: qsTr("Decline")
property string endCall: qsTr("End call") property string endCall: qsTr("End call")
property string incomingAudioCallFrom: qsTr("Incoming audio call from {}") property string incomingAudioCallFrom: qsTr("Incoming audio call from %1")
property string incomingVideoCallFrom: qsTr("Incoming video call from {}") property string incomingVideoCallFrom: qsTr("Incoming video call from %1")
property string newGroup: qsTr("Create new group") property string newGroup: qsTr("Create new group")
property string invitations: qsTr("Invitations") property string invitations: qsTr("Invitations")
property string description: qsTr("Jami is a universal communication platform, with privacy as its foundation, that relies on a free distributed network for everyone.") property string description: qsTr("Jami is a universal communication platform, with privacy as its foundation, that relies on a free distributed network for everyone.")
@@ -227,8 +227,8 @@ Item {
property string identifier: qsTr("Identifier") property string identifier: qsTr("Identifier")
// CallOverlay // CallOverlay
property string isRecording: qsTr("is recording") property string isRecording: qsTr("%1 is recording")
property string areRecording: qsTr("are recording") property string areRecording: qsTr("%1 are recording")
property string mute: qsTr("Mute microphone") property string mute: qsTr("Mute microphone")
property string unmute: qsTr("Unmute microphone") property string unmute: qsTr("Unmute microphone")
property string pauseCall: qsTr("Pause call") property string pauseCall: qsTr("Pause call")
@@ -346,8 +346,8 @@ Item {
property string backendError: qsTr("A backend system error occurred: %0") property string backendError: qsTr("A backend system error occurred: %0")
property string disabledAccount: qsTr("The account is disabled") property string disabledAccount: qsTr("The account is disabled")
property string noNetworkConnectivity: qsTr("No network connectivity") property string noNetworkConnectivity: qsTr("No network connectivity")
property string deletedMessage: qsTr("deleted a message") property string deletedMessage: qsTr("%1 deleted a message")
property string deletedMedia: qsTr("deleted a media") property string deletedMedia: qsTr("%1 deleted a media")
property string returnToCall: qsTr("Return to call") property string returnToCall: qsTr("Return to call")
// MessagesResearch // MessagesResearch
@@ -357,10 +357,10 @@ Item {
property string search: qsTr("Search") property string search: qsTr("Search")
// Chatview footer // Chatview footer
property string typeIndicatorSingle: qsTr("{} is typing…") property string typeIndicatorSingle: qsTr("%1 is typing…")
property string typeIndicatorPlural: qsTr("{} are typing…") property string typeIndicatorPlural: qsTr("%1 are typing…")
property string typeIndicatorMax: qsTr("Several people are typing…") property string typeIndicatorMax: qsTr("Several people are typing…")
property string typeIndicatorAnd: qsTr(" and ") property string typeIndicatorAnd: qsTr("%1 and %2")
// ConnectToAccountManager // ConnectToAccountManager
property string enterJAMSURL: qsTr("Enter the Jami Account Management Server (JAMS) URL") property string enterJAMSURL: qsTr("Enter the Jami Account Management Server (JAMS) URL")
@@ -411,7 +411,6 @@ Item {
property string saveAccountTitle: qsTr("Backup account") property string saveAccountTitle: qsTr("Backup account")
property string saveAccountDescription: qsTr("This Jami account exists only on this device. The account will be lost if this device is lost or the application is uninstalled. It is recommended to make a backup of this account.") property string saveAccountDescription: qsTr("This Jami account exists only on this device. The account will be lost if this device is lost or the application is uninstalled. It is recommended to make a backup of this account.")
property string deleteAccountTitle: qsTr("Delete account") property string deleteAccountTitle: qsTr("Delete account")
property string deleteAccountDescription: qsTr("If the account has not been backed up or added to another device, the account and registered username will be IRREVOCABLY LOST.")
property string linkedAccountList: qsTr("List of the devices that are linked to this account:") property string linkedAccountList: qsTr("List of the devices that are linked to this account:")
property string linkedThisDevice: qsTr("This device") property string linkedThisDevice: qsTr("This device")
property string linkedOtherDevices: qsTr("Other linked devices") property string linkedOtherDevices: qsTr("Other linked devices")
@@ -464,7 +463,7 @@ Item {
// DeleteAccountDialog // DeleteAccountDialog
property string confirmDeleteAccount: qsTr("Do you want to delete the account? To continue, click Delete.") property string confirmDeleteAccount: qsTr("Do you want to delete the account? To continue, click Delete.")
property string deleteAccountInfos: qsTr("If the account has not been backed up or added to another device, the account and registered username will be IRREVOCABLY LOST.") property string deleteAccountInfo: qsTr("If the account has not been backed up or added to another device, the account and registered username will be IRREVOCABLY LOST.")
// DeviceItemDelegate // DeviceItemDelegate
property string saveNewDeviceName: qsTr("Save") property string saveNewDeviceName: qsTr("Save")
@@ -501,7 +500,7 @@ Item {
// File transfer settings // File transfer settings
property string fileTransfer: qsTr("File transfer") property string fileTransfer: qsTr("File transfer")
property string autoAcceptFiles: qsTr("Automatically accept incoming files") property string autoAcceptFiles: qsTr("Automatically accept incoming files")
property string acceptTransferBelow: qsTr("Accept transfer limit (Mb)") property string acceptTransferBelow: qsTr("Accept transfer limit (MB)")
property string acceptTransferTooltip: qsTr("MB, 0 = unlimited") property string acceptTransferTooltip: qsTr("MB, 0 = unlimited")
// JamiUserIdentity settings // JamiUserIdentity settings
@@ -775,7 +774,7 @@ Item {
property string dontSend: qsTr("Don't send") property string dontSend: qsTr("Don't send")
property string replyTo: qsTr("Reply to") property string replyTo: qsTr("Reply to")
property string inReplyTo: qsTr("In reply to") property string inReplyTo: qsTr("In reply to")
property string repliedTo: qsTr(" replied to") property string repliedTo: qsTr("%1 replied to")
property string inReplyToMe: qsTr("Me") property string inReplyToMe: qsTr("Me")
property string reply: qsTr("Reply") property string reply: qsTr("Reply")
property string writeTo: qsTr("Write to %1") property string writeTo: qsTr("Write to %1")
@@ -895,6 +894,6 @@ Item {
property string connection: qsTr("Connection") property string connection: qsTr("Connection")
property string channels: qsTr("Channels") property string channels: qsTr("Channels")
property string copyAllData: qsTr("Copy all data") property string copyAllData: qsTr("Copy all data")
property string remote: qsTr("Remote: ") property string remote: qsTr("Remote: %1")
property string view: qsTr("View") property string view: qsTr("View")
} }

View File

@@ -330,7 +330,7 @@ ListView {
} }
} }
color: connectionImage.color color: connectionImage.color
property var tooltipText: JamiStrings.remote + RemoteAddress[index] property var tooltipText: JamiStrings.remote.arg(RemoteAddress[index])
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true

View File

@@ -350,7 +350,7 @@ SettingsPageBase {
"folder": StandardPaths.writableLocation(StandardPaths.DesktopLocation), "folder": StandardPaths.writableLocation(StandardPaths.DesktopLocation),
"nameFilters": [JamiStrings.jamiAccountFiles, JamiStrings.allFiles], "nameFilters": [JamiStrings.jamiAccountFiles, JamiStrings.allFiles],
"defaultSuffix": ".jac" "defaultSuffix": ".jac"
}) });
dlg.fileAccepted.connect(function (file) { dlg.fileAccepted.connect(function (file) {
// is there password? If so, go to password dialog, else, go to following directly // is there password? If so, go to password dialog, else, go to following directly
var exportPath = UtilsAdapter.getAbsPath(file.toString()); var exportPath = UtilsAdapter.getAbsPath(file.toString());
@@ -430,7 +430,7 @@ SettingsPageBase {
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true Layout.fillWidth: true
text: JamiStrings.deleteAccountDescription text: JamiStrings.deleteAccountInfo
color: JamiTheme.textColor color: JamiTheme.textColor
horizontalAlignment: Text.AlignLeft horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
@@ -466,7 +466,7 @@ SettingsPageBase {
onClicked: { onClicked: {
var dlg = viewCoordinator.presentDialog(appWindow, "commoncomponents/DeleteAccountDialog.qml", { var dlg = viewCoordinator.presentDialog(appWindow, "commoncomponents/DeleteAccountDialog.qml", {
"isSIP": CurrentAccount.type === Profile.Type.SIP, "isSIP": CurrentAccount.type === Profile.Type.SIP
}); });
dlg.accepted.connect(navigateToMainView); dlg.accepted.connect(navigateToMainView);
} }