Make the sensors module translatable, see #163

This commit is contained in:
Micke Prag 2013-02-14 15:58:42 +01:00
parent 30920ea816
commit 3b193bfaad
3 changed files with 13 additions and 14 deletions

View file

@ -2,7 +2,7 @@ import Qt 4.7
Text { Text {
id: headerTitle id: headerTitle
text: "Name" text: qsTr("Name")
color: "white" color: "white"
font.weight: Font.Bold font.weight: Font.Bold
height: parent.height height: parent.height

View file

@ -14,7 +14,7 @@ Column {
border.right: 5; border.bottom: 5 border.right: 5; border.bottom: 5
HeaderTitle { HeaderTitle {
text: "Name" text: qsTr("Name")
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 15 anchors.leftMargin: 15
} }
@ -26,21 +26,21 @@ Column {
} }
HeaderTitle { HeaderTitle {
id: sensorid id: sensorid
text: "ID" text: qsTr("ID")
anchors.right: modelTitle.left anchors.right: modelTitle.left
visible: main.state == "EDIT" visible: main.state == "EDIT"
width: 50 width: 50
} }
HeaderTitle { HeaderTitle {
id: modelTitle id: modelTitle
text: "Model" text: qsTr("Model")
anchors.right: visibleinlistTitle.left anchors.right: visibleinlistTitle.left
visible: main.state == "EDIT" visible: main.state == "EDIT"
width: 100 width: 100
} }
HeaderTitle { HeaderTitle {
id: visibleinlistTitle id: visibleinlistTitle
text: "Visible in list" text: qsTr("Visible in list")
anchors.right: sensorinformationTitle.left anchors.right: sensorinformationTitle.left
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
visible: main.state == "EDIT" visible: main.state == "EDIT"
@ -48,13 +48,13 @@ Column {
} }
HeaderTitle { HeaderTitle {
id: sensorinformationTitle id: sensorinformationTitle
text: "Sensor information" text: qsTr("Sensor information")
width: 150 width: 150
anchors.right: timestampTitle.left anchors.right: timestampTitle.left
} }
HeaderTitle { HeaderTitle {
id: timestampTitle id: timestampTitle
text: "Last updated" text: qsTr("Last updated")
width: 100 width: 100
anchors.right: parent.right anchors.right: parent.right
//horizontalAlignment: Text.AlignRight //horizontalAlignment: Text.AlignRight
@ -67,9 +67,8 @@ Column {
Row{ Row{
spacing: 20 spacing: 20
Button { Button {
width: 50
height: 20 height: 20
text: main.state == "VIEW" ? "Edit" : "View" text: main.state == "VIEW" ? qsTr("Edit") : qsTr("View")
onClicked: { onClicked: {
if(main.state == "VIEW"){ if(main.state == "VIEW"){
main.state = "EDIT" main.state = "EDIT"

View file

@ -26,7 +26,7 @@ Item{
anchors.leftMargin: 15 anchors.leftMargin: 15
height: 40 height: 40
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
text: modelData.name == '' ? '<unnamed>' : modelData.name; text: modelData.name == '' ? qsTr('<unnamed>') : modelData.name;
color: "#004275" color: "#004275"
} }
TextField { TextField {
@ -37,7 +37,7 @@ Item{
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: (40-nameEdit.height)/2 anchors.topMargin: (40-nameEdit.height)/2
text: modelData.name; text: modelData.name;
placeholderText: 'Enter a name' placeholderText: qsTr('Enter a name')
onTextChanged: modelData.name = text onTextChanged: modelData.name = text
} }
Item { Item {
@ -116,10 +116,10 @@ Item{
Dialog{ Dialog{
id: confirmDeletion id: confirmDeletion
modal: true modal: true
title: "Confirm deletion" title: qsTr("Confirm deletion")
Text{ Text{
id: descriptionHeadline id: descriptionHeadline
text:"Delete this sensor?" text: qsTr("Delete this sensor?")
font.bold: true font.bold: true
} }
Text{ Text{
@ -129,7 +129,7 @@ Item{
width: parent.width - 20 width: parent.width - 20
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 10 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 wrapMode: Text.Wrap
} }