1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-03-28 14:56:19 +01:00

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
topPadding: 6
leftPadding: 10
text: UtilsAdapter.getBestNameForUri(CurrentAccount.id, Author) + " " + JamiStrings.deletedMedia
text: JamiStrings.deletedMedia.arg(UtilsAdapter.getBestNameForUri(CurrentAccount.id, Author))
horizontalAlignment: Text.AlignLeft
width: Math.min((2 / 3) * parent.width, implicitWidth + 18, innerContent.width - senderMargin + 18)

View file

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

View file

@ -59,7 +59,7 @@ BaseModalDialog {
Layout.fillWidth: true
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
}
}

View file

@ -152,7 +152,7 @@ Control {
text: textMetricsUsername1.elidedText
TextMetrics {
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
elide: Qt.ElideMiddle
}
@ -688,7 +688,7 @@ Control {
readers: root.readers
}
Component {
Component {
id: selfReadIconComp
Avatar {
width: JamiTheme.avatarReadReceiptSize

View file

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

View file

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

View file

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

View file

@ -30,8 +30,8 @@ Item {
property string acceptVideo: qsTr("Accept with video")
property string refuse: qsTr("Decline")
property string endCall: qsTr("End call")
property string incomingAudioCallFrom: qsTr("Incoming audio call from {}")
property string incomingVideoCallFrom: qsTr("Incoming video call from {}")
property string incomingAudioCallFrom: qsTr("Incoming audio call from %1")
property string incomingVideoCallFrom: qsTr("Incoming video call from %1")
property string newGroup: qsTr("Create new group")
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.")
@ -227,8 +227,8 @@ Item {
property string identifier: qsTr("Identifier")
// CallOverlay
property string isRecording: qsTr("is recording")
property string areRecording: qsTr("are recording")
property string isRecording: qsTr("%1 is recording")
property string areRecording: qsTr("%1 are recording")
property string mute: qsTr("Mute microphone")
property string unmute: qsTr("Unmute microphone")
property string pauseCall: qsTr("Pause call")
@ -346,8 +346,8 @@ Item {
property string backendError: qsTr("A backend system error occurred: %0")
property string disabledAccount: qsTr("The account is disabled")
property string noNetworkConnectivity: qsTr("No network connectivity")
property string deletedMessage: qsTr("deleted a message")
property string deletedMedia: qsTr("deleted a media")
property string deletedMessage: qsTr("%1 deleted a message")
property string deletedMedia: qsTr("%1 deleted a media")
property string returnToCall: qsTr("Return to call")
// MessagesResearch
@ -357,10 +357,10 @@ Item {
property string search: qsTr("Search")
// Chatview footer
property string typeIndicatorSingle: qsTr("{} is typing…")
property string typeIndicatorPlural: qsTr("{} are typing…")
property string typeIndicatorSingle: qsTr("%1 is typing…")
property string typeIndicatorPlural: qsTr("%1 are typing…")
property string typeIndicatorMax: qsTr("Several people are typing…")
property string typeIndicatorAnd: qsTr(" and ")
property string typeIndicatorAnd: qsTr("%1 and %2")
// ConnectToAccountManager
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 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 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 linkedThisDevice: qsTr("This device")
property string linkedOtherDevices: qsTr("Other linked devices")
@ -464,7 +463,7 @@ Item {
// DeleteAccountDialog
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
property string saveNewDeviceName: qsTr("Save")
@ -501,7 +500,7 @@ Item {
// File transfer settings
property string fileTransfer: qsTr("File transfer")
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")
// JamiUserIdentity settings
@ -775,7 +774,7 @@ Item {
property string dontSend: qsTr("Don't send")
property string replyTo: qsTr("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 reply: qsTr("Reply")
property string writeTo: qsTr("Write to %1")
@ -895,6 +894,6 @@ Item {
property string connection: qsTr("Connection")
property string channels: qsTr("Channels")
property string copyAllData: qsTr("Copy all data")
property string remote: qsTr("Remote: ")
property string remote: qsTr("Remote: %1")
property string view: qsTr("View")
}

View file

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

View file

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