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 {
id: headerTitle
text: "Name"
text: qsTr("Name")
color: "white"
font.weight: Font.Bold
height: parent.height

View file

@ -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"

View file

@ -26,7 +26,7 @@ Item{
anchors.leftMargin: 15
height: 40
verticalAlignment: Text.AlignVCenter
text: modelData.name == '' ? '<unnamed>' : modelData.name;
text: modelData.name == '' ? qsTr('<unnamed>') : 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
}