From 3b193bfaadcf91e39d5191dbca5361967374e1ae Mon Sep 17 00:00:00 2001 From: Micke Prag Date: Thu, 14 Feb 2013 15:58:42 +0100 Subject: [PATCH] Make the sensors module translatable, see #163 --- telldus-gui/Plugins/Sensors/HeaderTitle.qml | 2 +- telldus-gui/Plugins/Sensors/SensorList.qml | 15 +++++++-------- telldus-gui/Plugins/Sensors/SensorView.qml | 10 +++++----- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/telldus-gui/Plugins/Sensors/HeaderTitle.qml b/telldus-gui/Plugins/Sensors/HeaderTitle.qml index 0d7ae213..41c568d3 100644 --- a/telldus-gui/Plugins/Sensors/HeaderTitle.qml +++ b/telldus-gui/Plugins/Sensors/HeaderTitle.qml @@ -2,7 +2,7 @@ import Qt 4.7 Text { id: headerTitle - text: "Name" + text: qsTr("Name") color: "white" font.weight: Font.Bold height: parent.height diff --git a/telldus-gui/Plugins/Sensors/SensorList.qml b/telldus-gui/Plugins/Sensors/SensorList.qml index ea1ed7c4..b60f0fa5 100644 --- a/telldus-gui/Plugins/Sensors/SensorList.qml +++ b/telldus-gui/Plugins/Sensors/SensorList.qml @@ -14,7 +14,7 @@ Column { border.right: 5; border.bottom: 5 HeaderTitle { - text: "Name" + text: qsTr("Name") anchors.left: parent.left anchors.leftMargin: 15 } @@ -26,21 +26,21 @@ Column { } HeaderTitle { id: sensorid - text: "ID" + text: qsTr("ID") anchors.right: modelTitle.left visible: main.state == "EDIT" width: 50 } HeaderTitle { id: modelTitle - text: "Model" + text: qsTr("Model") anchors.right: visibleinlistTitle.left visible: main.state == "EDIT" width: 100 } HeaderTitle { id: visibleinlistTitle - text: "Visible in list" + text: qsTr("Visible in list") anchors.right: sensorinformationTitle.left horizontalAlignment: Text.AlignHCenter visible: main.state == "EDIT" @@ -48,13 +48,13 @@ Column { } HeaderTitle { id: sensorinformationTitle - text: "Sensor information" + text: qsTr("Sensor information") width: 150 anchors.right: timestampTitle.left } HeaderTitle { id: timestampTitle - text: "Last updated" + text: qsTr("Last updated") width: 100 anchors.right: parent.right //horizontalAlignment: Text.AlignRight @@ -67,9 +67,8 @@ Column { Row{ spacing: 20 Button { - width: 50 height: 20 - text: main.state == "VIEW" ? "Edit" : "View" + text: main.state == "VIEW" ? qsTr("Edit") : qsTr("View") onClicked: { if(main.state == "VIEW"){ main.state = "EDIT" diff --git a/telldus-gui/Plugins/Sensors/SensorView.qml b/telldus-gui/Plugins/Sensors/SensorView.qml index a3626bcb..f577b9d0 100644 --- a/telldus-gui/Plugins/Sensors/SensorView.qml +++ b/telldus-gui/Plugins/Sensors/SensorView.qml @@ -26,7 +26,7 @@ Item{ anchors.leftMargin: 15 height: 40 verticalAlignment: Text.AlignVCenter - text: modelData.name == '' ? '' : modelData.name; + text: modelData.name == '' ? qsTr('') : modelData.name; color: "#004275" } TextField { @@ -37,7 +37,7 @@ Item{ anchors.top: parent.top anchors.topMargin: (40-nameEdit.height)/2 text: modelData.name; - placeholderText: 'Enter a name' + placeholderText: qsTr('Enter a name') onTextChanged: modelData.name = text } Item { @@ -116,10 +116,10 @@ Item{ Dialog{ id: confirmDeletion modal: true - title: "Confirm deletion" + title: qsTr("Confirm deletion") Text{ id: descriptionHeadline - text:"Delete this sensor?" + text: qsTr("Delete this sensor?") font.bold: true } Text{ @@ -129,7 +129,7 @@ Item{ width: parent.width - 20 anchors.left: parent.left anchors.leftMargin: 10 - text: "Please note that a sensor that is still transmitting will reappear here again, but it will be hidden in the list by default." + text: qsTr("Please note that a sensor that is still transmitting will reappear here again, but it will be hidden in the list by default.") wrapMode: Text.Wrap }