A system of translations into different languages has been implemented. Added translations into Russian. Various UI fixes for valid internationalization

This commit is contained in:
Yury Shuvakin
2022-08-28 11:33:56 +03:00
parent 2a960893d0
commit 4a0f78c247
39 changed files with 3365 additions and 357 deletions

View File

@@ -12,6 +12,8 @@ RowLayout {
property real contentRowSpacing: 20
property real contentColumnSpacing: 35
signal needWait(bool active, string text)
spacing: contentColumnSpacing
Flickable {
@@ -163,12 +165,16 @@ RowLayout {
Controls.SubtitleLabel {
text: qsTr("Maximum charge current, A")
maximumLineCount: 2
wrapMode: Text.WordWrap
Layout.fillWidth: true
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
}
Controls.SubtitleLabel {
text: qsTr("Maximum load current, A")
maximumLineCount: 2
wrapMode: Text.WordWrap
Layout.fillWidth: true
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
}
@@ -189,6 +195,8 @@ RowLayout {
Controls.SubtitleLabel {
text: qsTr("Maximum temperature, °C")
maximumLineCount: 2
wrapMode: Text.WordWrap
Layout.fillWidth: true
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
Layout.columnSpan: 2
@@ -224,12 +232,16 @@ RowLayout {
Controls.SubtitleLabel {
text: qsTr("Lower disable threshold, V")
maximumLineCount: 2
wrapMode: Text.WordWrap
Layout.fillWidth: true
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
}
Controls.SubtitleLabel {
text: qsTr("Upper disable threshold, V")
maximumLineCount: 2
wrapMode: Text.WordWrap
Layout.fillWidth: true
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
}
@@ -250,14 +262,16 @@ RowLayout {
Controls.SubtitleLabel {
text: qsTr("Lower enable threshold (should be higher than disable), V")
maximumLineCount: 2
maximumLineCount: 3
wrapMode: Text.WordWrap
Layout.fillWidth: true
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
}
Controls.SubtitleLabel {
text: qsTr("Upper enable threshold (should be higher than disable), V")
maximumLineCount: 2
maximumLineCount: 3
wrapMode: Text.WordWrap
Layout.fillWidth: true
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
}
@@ -328,6 +342,8 @@ RowLayout {
Controls.SubtitleLabel {
text: qsTr("Cell balancing interval, ms")
maximumLineCount: 2
wrapMode: Text.WordWrap
Layout.fillWidth: true
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
Layout.columnSpan: 2
@@ -367,13 +383,13 @@ RowLayout {
spacing: 20
Controls.LabelWithBackground {
text: qsTr(" 1")
text: qsTr("# 1")
Layout.preferredWidth: outputSettingsFrame.outputNumberSize
Layout.preferredHeight: outputSettingsFrame.outputNumberSize
}
Controls.CheckBox {
text: qsTr("Use for management")
text: qsTr("Use for storage management")
Layout.fillWidth: true
Layout.preferredHeight: outputSettingsFrame.outputNumberSize
}
@@ -391,7 +407,7 @@ RowLayout {
spacing: 20
Controls.LabelWithBackground {
text: qsTr(" 2")
text: qsTr("# 2")
Layout.preferredWidth: outputSettingsFrame.outputNumberSize
Layout.preferredHeight: outputSettingsFrame.outputNumberSize
}
@@ -408,6 +424,8 @@ RowLayout {
Controls.SubtitleLabel {
text: qsTr("Change in value during SOC")
maximumLineCount: 2
wrapMode: Text.WordWrap
Layout.fillWidth: true
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
Layout.columnSpan: 2
@@ -429,7 +447,7 @@ RowLayout {
spacing: 20
Controls.LabelWithBackground {
text: qsTr(" 3")
text: qsTr("# 3")
Layout.preferredWidth: outputSettingsFrame.outputNumberSize
Layout.preferredHeight: outputSettingsFrame.outputNumberSize
}
@@ -476,7 +494,7 @@ RowLayout {
spacing: 20
Controls.LabelWithBackground {
text: qsTr(" 4")
text: qsTr("# 4")
Layout.preferredWidth: outputSettingsFrame.outputNumberSize
Layout.preferredHeight: outputSettingsFrame.outputNumberSize
}
@@ -534,7 +552,7 @@ RowLayout {
anchors.fill: parent
Controls.SubtitleLabel {
text: qsTr("Current sensor value «0»")
text: qsTr("Current sensor value \"0\"")
Layout.fillWidth: true
Layout.columnSpan: 2
}
@@ -549,7 +567,7 @@ RowLayout {
Controls.Button {
id: zeroSensorValueCalibrationButton
text: qsTr("Calibrate «0»")
text: qsTr("Calibrate \"0\"")
Layout.fillWidth: true
Layout.maximumWidth: (parent.width - parent.columnSpacing) / 2
Layout.columnSpan: 2
@@ -561,6 +579,7 @@ RowLayout {
Controls.OutlineButton {
text: qsTr("Load settings from file")
onClicked: loadFileDialog.open()
Layout.preferredWidth: 270
FileDialog {
id: loadFileDialog
@@ -576,6 +595,7 @@ RowLayout {
Controls.OutlineButton {
text: qsTr("Save settings to file")
onClicked: saveFileDialog.open()
Layout.preferredWidth: 270
FileDialog {
id: saveFileDialog
@@ -637,7 +657,7 @@ RowLayout {
}
Controls.LinkLabel {
text: qsTr("Current sensor value «0»")
text: qsTr("Current sensor value \"0\"")
onClicked: settingsFlickable.contentY = zeroSensorSettingsFrame.mapToItem(settingsFlickable.contentItem, 0, 0).y
}
@@ -649,7 +669,7 @@ RowLayout {
spacing: 15
Controls.OutlineButton {
text: qsTr("Read settings from file")
text: qsTr("Read default settings")
Layout.fillWidth: true
onClicked: BmsInterface.commands().getBMSconfDefault()
}
@@ -661,15 +681,6 @@ RowLayout {
}
Controls.OutlineButton {
text: qsTr("Write to non-volatile memory of BMS")
Layout.fillWidth: true
onClicked: {
writeValuesToConfig()
BmsInterface.commands().storeBMSConfig()
}
}
Controls.Button {
text: qsTr("Write current values to BMS")
Layout.fillWidth: true
onClicked: {
@@ -678,10 +689,20 @@ RowLayout {
}
}
Controls.Button {
text: qsTr("Write to non-volatile memory of BMS")
Layout.fillWidth: true
onClicked: {
needWait(true, qsTr("The settings are written to non-volatile memory.\nWait, please."))
writeValuesToConfig()
BmsInterface.commands().storeBMSConfig()
}
}
Layout.fillWidth: true
}
Layout.maximumWidth: 320
Layout.maximumWidth: 280
Layout.fillHeight: true
}