From 60a6a31f14744b936ce51526bb1bcb8b95d5f6e2 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 24 Mar 2016 18:11:40 -0300 Subject: [PATCH] Random additions to the qml qsTr calls Signed-off-by: Tomaz Canabrava --- src/FlightMap/Widgets/VibrationWidget.qml | 18 ++-- src/MissionEditor/MissionEditor.qml | 42 +++++----- src/MissionEditor/MissionItemStatus.qml | 10 +-- src/MissionEditor/SimpleItemEditor.qml | 4 +- src/MissionEditor/SurveyItemEditor.qml | 2 +- src/QmlControls/MissionCommandDialog.qml | 2 +- src/QmlControls/MissionItemEditor.qml | 10 +-- src/QmlControls/ModeSwitchDisplay.qml | 4 +- src/QmlControls/ParameterEditor.qml | 32 +++---- src/QmlControls/ParameterEditorDialog.qml | 26 +++--- src/QmlControls/QGCMobileFileDialog.qml | 8 +- src/QmlControls/QGCView.qml | 38 ++++----- src/QmlControls/ScreenTools.qml | 2 +- src/QmlControls/SliderSwitch.qml | 2 +- .../QMLControl/OfflineMap.qml | 84 +++++++++---------- 15 files changed, 141 insertions(+), 143 deletions(-) diff --git a/src/FlightMap/Widgets/VibrationWidget.qml b/src/FlightMap/Widgets/VibrationWidget.qml index cc973fef8..fb28fce64 100644 --- a/src/FlightMap/Widgets/VibrationWidget.qml +++ b/src/FlightMap/Widgets/VibrationWidget.qml @@ -60,7 +60,7 @@ QGCFlickable { QGCLabel { id: title color: textColor - text: "Vibe" + text: qsTr("Vibe") anchors.horizontalCenter: barRow.horizontalCenter } @@ -84,7 +84,7 @@ QGCFlickable { QGCLabel { id: xBarLabel color: textColor - text: "X" + text: qsTr("X") anchors.horizontalCenter: xBar.horizontalCenter } } @@ -102,7 +102,7 @@ QGCFlickable { QGCLabel { anchors.horizontalCenter: yBar.horizontalCenter color: textColor - text: "Y" + text: qsTr("Y") } } @@ -119,7 +119,7 @@ QGCFlickable { QGCLabel { anchors.horizontalCenter: zBar.horizontalCenter color: textColor - text: "Z" + text: qsTr("Z") } } } // Row @@ -141,7 +141,7 @@ QGCFlickable { anchors.left: barRow.right anchors.right: parent.right color: textColor - text: "Clip count" + text: qsTr("Clip count") horizontalAlignment: Text.AlignHCenter } @@ -151,17 +151,17 @@ QGCFlickable { anchors.horizontalCenter: clipLabel.horizontalCenter QGCLabel { - text: "Accel 1: " + (_activeVehicle ? _activeVehicle.vibration.clipCount1.valueString : "") + text: qsTr("Accel 1: ") + (_activeVehicle ? _activeVehicle.vibration.clipCount1.valueString : "") color: textColor } QGCLabel { - text: "Accel 2: " + (_activeVehicle ? _activeVehicle.vibration.clipCount2.valueString : "") + text: qsTr("Accel 2: ") + (_activeVehicle ? _activeVehicle.vibration.clipCount2.valueString : "") color: textColor } QGCLabel { - text: "Accel 2: " + (_activeVehicle ? _activeVehicle.vibration.clipCount3.valueString : "") + text: qsTr("Accel 2: ") + (_activeVehicle ? _activeVehicle.vibration.clipCount3.valueString : "") color: textColor } } @@ -175,7 +175,7 @@ QGCFlickable { QGCLabel { anchors.fill: parent - text: "Not Available" + text: qsTr("Not Available") color: textColor horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter diff --git a/src/MissionEditor/MissionEditor.qml b/src/MissionEditor/MissionEditor.qml index da363f142..2cbf37e8b 100644 --- a/src/MissionEditor/MissionEditor.qml +++ b/src/MissionEditor/MissionEditor.qml @@ -90,7 +90,7 @@ QGCView { function loadFromFile() { if (ScreenTools.isMobile) { - _root.showDialog(mobileFilePicker, "Select Mission File", _root.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) + _root.showDialog(mobileFilePicker, qsTr("Select Mission File"), _root.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) } else { controller.loadMissionFromFilePicker() fitViewportToMissionItems() @@ -99,7 +99,7 @@ QGCView { function saveToFile() { if (ScreenTools.isMobile) { - _root.showDialog(mobileFileSaver, "Save Mission File", _root.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel) + _root.showDialog(mobileFileSaver, qsTr("Save Mission File"), _root.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel) } else { controller.saveMissionToFilePicker() } @@ -238,7 +238,7 @@ QGCView { anchors.left: parent.left anchors.right: parent.right wrapMode: Text.WordWrap - text: "Move the selected mission item to the be after following mission item:" + text: qsTr("Move the selected mission item to the be after following mission item:") } QGCComboBox { @@ -585,13 +585,13 @@ QGCView { dropDownComponent: Component { Column { - QGCLabel { text: "Center map:" } + QGCLabel { text: qsTr("Center map:") } Row { spacing: ScreenTools.defaultFontPixelWidth QGCButton { - text: "Home" + text: qsTr("Home") onClicked: { centerMapButton.hideDropDown() @@ -600,7 +600,7 @@ QGCView { } QGCButton { - text: "Mission" + text: qsTr("Mission") onClicked: { centerMapButton.hideDropDown() @@ -609,7 +609,7 @@ QGCView { } QGCButton { - text: "Vehicle" + text: qsTr("Vehicle") enabled: activeVehicle && activeVehicle.latitude != 0 && activeVehicle.longitude != 0 property var activeVehicle: _activeVehicle @@ -635,7 +635,7 @@ QGCView { dropDownComponent: Component { Column { - QGCLabel { text: "Map type:" } + QGCLabel { text: qsTr("Map type:") } Row { spacing: ScreenTools.defaultFontPixelWidth @@ -712,7 +712,7 @@ QGCView { QGCViewMessage { id: syncLoadFromVehicleCheck - message: "You have unsaved/unsent mission changes. Loading the mission from the Vehicle will lose these changes. Are you sure you want to load the mission from the Vehicle?" + message: qsTr("You have unsaved/unsent mission changes. Loading the mission from the Vehicle will lose these changes. Are you sure you want to load the mission from the Vehicle?") function accept() { hideDialog() @@ -726,7 +726,7 @@ QGCView { QGCViewMessage { id: syncLoadFromVehicleCheck - message: "You have unsaved/unsent mission changes. Loading a mission from a file will lose these changes. Are you sure you want to load a mission from a file?" + message: qsTr("You have unsaved/unsent mission changes. Loading a mission from a file will lose these changes. Are you sure you want to load a mission from a file?") function accept() { hideDialog() @@ -739,7 +739,7 @@ QGCView { id: removeAllPromptDialog QGCViewMessage { - message: "Are you sure you want to delete all mission items?" + message: qsTr("Are you sure you want to delete all mission items?") function accept() { itemDragger.clearItem() @@ -760,8 +760,8 @@ QGCView { width: sendSaveRow.width wrapMode: Text.WordWrap text: syncNeeded && !controller.autoSync ? - "You have unsaved changes to you mission. You should send to your vehicle, or save to a file:" : - "Sync:" + qsTr("You have unsaved changed to you mission. You should send to your vehicle, or save to a file:") : + qsTr("Sync:") } Row { @@ -770,7 +770,7 @@ QGCView { spacing: ScreenTools.defaultFontPixelWidth QGCButton { - text: "Send to vehicle" + text: qsTr("Send to vehicle") enabled: _activeVehicle && !controller.syncInProgress onClicked: { @@ -780,13 +780,13 @@ QGCView { } QGCButton { - text: "Load from vehicle" + text: qsTr("Load from vehicle") enabled: _activeVehicle && !controller.syncInProgress onClicked: { syncButton.hideDropDown() if (syncNeeded) { - _root.showDialog(syncLoadFromVehicleOverwrite, "Mission overwrite", _root.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) + _root.showDialog(syncLoadFromVehicleOverwrite, qsTr("Mission overwrite"), _root.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) } else { loadFromVehicle() } @@ -798,7 +798,7 @@ QGCView { spacing: ScreenTools.defaultFontPixelWidth QGCButton { - text: "Save to file..." + text: qsTr("Save to file...") enabled: !controller.syncInProgress onClicked: { @@ -808,13 +808,13 @@ QGCView { } QGCButton { - text: "Load from file..." + text: qsTr("Load from file...") enabled: !controller.syncInProgress onClicked: { syncButton.hideDropDown() if (syncNeeded) { - _root.showDialog(syncLoadFromFileOverwrite, "Mission overwrite", _root.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) + _root.showDialog(syncLoadFromFileOverwrite, qsTr("Mission overwrite"), _root.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) } else { loadFromFile() } @@ -823,10 +823,10 @@ QGCView { } QGCButton { - text: "Remove all" + text: qsTr("Remove all") onClicked: { syncButton.hideDropDown() - _root.showDialog(removeAllPromptDialog, "Delete all", _root.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No) + _root.showDialog(removeAllPromptDialog, qsTr("Delete all"), _root.showDialogDefaultWidth, StandardButton.Yes | StandardButton.No) } } diff --git a/src/MissionEditor/MissionItemStatus.qml b/src/MissionEditor/MissionItemStatus.qml index 45f8fa823..1851f1d73 100644 --- a/src/MissionEditor/MissionItemStatus.qml +++ b/src/MissionEditor/MissionItemStatus.qml @@ -71,18 +71,17 @@ Rectangle { columns: 2 columnSpacing: _margins - QGCLabel { text: "Distance:" } + QGCLabel { text: qsTr("Distance:") } QGCLabel { text: _distanceText } - QGCLabel { text: "Alt diff:" } + QGCLabel { text: qsTr("Alt diff:") } QGCLabel { text: _altText } - QGCLabel { text: "Gradient:" } + QGCLabel { text: qsTr("Gradient:") } QGCLabel { text: _gradientText } - QGCLabel { text: "Azimuth:" } + QGCLabel { text: qsTr("Azimuth:") } QGCLabel { text: _azimuthText } - } QGCFlickable { anchors.leftMargin: _margins @@ -133,7 +132,6 @@ Rectangle { } */ } - } } } diff --git a/src/MissionEditor/SimpleItemEditor.qml b/src/MissionEditor/SimpleItemEditor.qml index 25d7d68c2..8141913e2 100644 --- a/src/MissionEditor/SimpleItemEditor.qml +++ b/src/MissionEditor/SimpleItemEditor.qml @@ -42,9 +42,9 @@ Rectangle { wrapMode: Text.WordWrap font.pixelSize: ScreenTools.smallFontPixelHeight text: missionItem.sequenceNumber == 0 ? - "Planned home position." : + qsTr("Planned home position.") : (missionItem.rawEdit ? - "Provides advanced access to all commands/parameters. Be very careful!" : + qsTr("Provides advanced access to all commands/parameters. Be very careful!") : missionItem.commandDescription) } diff --git a/src/MissionEditor/SurveyItemEditor.qml b/src/MissionEditor/SurveyItemEditor.qml index 169978620..579b5e96b 100644 --- a/src/MissionEditor/SurveyItemEditor.qml +++ b/src/MissionEditor/SurveyItemEditor.qml @@ -43,7 +43,7 @@ Rectangle { } QGCLabel { - text: "Fly a grid pattern over a defined area." + text: qsTr("Fly a grid pattern over a defined area.") wrapMode: Text.WordWrap } diff --git a/src/QmlControls/MissionCommandDialog.qml b/src/QmlControls/MissionCommandDialog.qml index b5714d91d..22bd172a1 100644 --- a/src/QmlControls/MissionCommandDialog.qml +++ b/src/QmlControls/MissionCommandDialog.qml @@ -41,7 +41,7 @@ QGCViewDialog { QGCLabel { id: categoryLabel anchors.baseline: categoryCombo.baseline - text: "Category:" + text: qsTr("Category:") } QGCComboBox { diff --git a/src/QmlControls/MissionItemEditor.qml b/src/QmlControls/MissionItemEditor.qml index 937b7d483..540645fc9 100644 --- a/src/QmlControls/MissionItemEditor.qml +++ b/src/QmlControls/MissionItemEditor.qml @@ -73,12 +73,12 @@ Rectangle { id: hamburgerMenu MenuItem { - text: "Insert" + text: qsTr("Insert") onTriggered: insert(missionItem.sequenceNumber) } MenuItem { - text: "Delete" + text: qsTr("Delete") onTriggered: remove() } @@ -92,7 +92,7 @@ Rectangle { } MenuItem { - text: "Show all values" + text: qsTr("Show all values") checkable: true checked: missionItem.isSimpleItem ? missionItem.rawEdit : false visible: missionItem.isSimpleItem @@ -102,7 +102,7 @@ Rectangle { if (missionItem.friendlyEditAllowed) { missionItem.rawEdit = false } else { - qgcView.showMessage("Mission Edit", "You have made changes to the mission item which cannot be shown in Simple Mode", StandardButton.Ok) + qgcView.showMessage(qsTr("Mission Edit"), qsTr("You have made changes to the mission item which cannot be shown in Simple Mode"), StandardButton.Ok) } } else { missionItem.rawEdit = true @@ -133,7 +133,7 @@ Rectangle { } } - onClicked: qgcView.showDialog(commandDialog, "Select Mission Command", qgcView.showDialogDefaultWidth, StandardButton.Cancel) + onClicked: qgcView.showDialog(commandDialog, qsTr("Select Mission Command"), qgcView.showDialogDefaultWidth, StandardButton.Cancel) } QGCLabel { diff --git a/src/QmlControls/ModeSwitchDisplay.qml b/src/QmlControls/ModeSwitchDisplay.qml index 601e9cbba..44b03bc36 100644 --- a/src/QmlControls/ModeSwitchDisplay.qml +++ b/src/QmlControls/ModeSwitchDisplay.qml @@ -104,7 +104,7 @@ Rectangle { width: ScreenTools.defaultFontPixelWidth * monitorThresholdCharWidth height: ScreenTools.defaultFontPixelHeight verticalAlignment: Text.AlignVCenter - text: "Monitor:" + text: qsTr("Monitor:") } Item { @@ -144,7 +144,7 @@ Rectangle { width: ScreenTools.defaultFontPixelWidth * monitorThresholdCharWidth height: ScreenTools.defaultFontPixelHeight verticalAlignment: Text.AlignVCenter - text: "Threshold:" + text: qsTr("Threshold:") } diff --git a/src/QmlControls/ParameterEditor.qml b/src/QmlControls/ParameterEditor.qml index c0ccf753f..6e8604adc 100644 --- a/src/QmlControls/ParameterEditor.qml +++ b/src/QmlControls/ParameterEditor.qml @@ -54,7 +54,7 @@ QGCView { id: controller; factPanel: panel onShowErrorMessage: { - showMessage("Parameter Load Errors", errorMsg, StandardButton.Ok) + showMessage(qsTr("Parameter Load Errors"), errorMsg, StandardButton.Ok) } } @@ -71,7 +71,7 @@ QGCView { width: parent.width height: ScreenTools.defaultFontPixelHeight * 1.75 QGCLabel { - text: "Search Results" + text: qsTr("Search Results") visible: _searchFilter font.weight: Font.DemiBold anchors.verticalCenter: parent.verticalCenter @@ -82,13 +82,13 @@ QGCView { width: ScreenTools.defaultFontPixelWidth * 25 anchors.verticalCenter: parent.verticalCenter QGCLabel { - text: "GROUPS" + text: qsTr("GROUPS") font.weight: Font.DemiBold anchors.centerIn: parent } } QGCLabel { - text: _currentGroup + " Parameters" + text: qsTr("%1 Parameters").arg(_currentGroup) visible: !_searchFilter font.weight: Font.DemiBold anchors.left: groupTitle.right @@ -96,7 +96,7 @@ QGCView { anchors.verticalCenter: parent.verticalCenter } QGCButton { - text: "Back" + text: qsTr("Back") visible: _searchFilter anchors.right: parent.right height: ScreenTools.defaultFontPixelHeight * 1.75 @@ -106,39 +106,39 @@ QGCView { } } QGCButton { - text: "Tools" + text: qsTr("Tools") visible: !_searchFilter anchors.right: parent.right height: ScreenTools.defaultFontPixelHeight * 1.75 menu: Menu { MenuItem { - text: "Refresh" + text: qsTr("Refresh") onTriggered: controller.refresh() } MenuItem { - text: "Reset all to defaults" + text: qsTr("Reset all to defaults") onTriggered: controller.resetAllToDefaults() } MenuItem { - text: "Search..." - onTriggered: showDialog(searchDialogComponent, "Parameter Search", qgcView.showDialogDefaultWidth, StandardButton.Reset | StandardButton.Apply) + text: qsTr("Search...") + onTriggered: showDialog(searchDialogComponent, qsTr("Parameter Search"), qgcView.showDialogDefaultWidth, StandardButton.Reset | StandardButton.Apply) } MenuSeparator { } MenuItem { - text: "Load from file..." + text: qsTr("Load from file...") onTriggered: { if (ScreenTools.isMobile) { - qgcView.showDialog(mobileFilePicker, "Select Parameter File", qgcView.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) + qgcView.showDialog(mobileFilePicker, qsTr("Select Parameter File"), qgcView.showDialogDefaultWidth, StandardButton.Yes | StandardButton.Cancel) } else { controller.loadFromFilePicker() } } } MenuItem { - text: "Save to file..." + text: qsTr("Save to file...") onTriggered: { if (ScreenTools.isMobile) { - qgcView.showDialog(mobileFileSaver, "Save Parameter File", qgcView.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel) + qgcView.showDialog(mobileFileSaver, qsTr("Save Parameter File"), qgcView.showDialogDefaultWidth, StandardButton.Save | StandardButton.Cancel) } else { controller.saveToFilePicker() } @@ -146,7 +146,7 @@ QGCView { } MenuSeparator { visible: _showRCToParam } MenuItem { - text: "Clear RC to Param" + text: qsTr("Clear RC to Param") onTriggered: controller.clearRCToParam() visible: _showRCToParam } @@ -195,7 +195,7 @@ QGCView { readonly property int componentId: parseInt(modelData) spacing: Math.ceil(ScreenTools.defaultFontPixelHeight * 0.25) QGCLabel { - text: "Component #: " + componentId.toString() + text: qsTr("Component #: %1)").arg(componentId.toString()) font.weight: Font.DemiBold anchors.horizontalCenter: parent.horizontalCenter } diff --git a/src/QmlControls/ParameterEditorDialog.qml b/src/QmlControls/ParameterEditorDialog.qml index 7a0bb3b10..e357c5ef9 100644 --- a/src/QmlControls/ParameterEditorDialog.qml +++ b/src/QmlControls/ParameterEditorDialog.qml @@ -111,7 +111,7 @@ QGCViewDialog { QGCButton { anchors.baseline: valueField.baseline visible: fact.defaultValueAvailable - text: "Reset to default" + text: qsTr("Reset to default") onClicked: { fact.value = fact.defaultValue @@ -143,15 +143,15 @@ QGCViewDialog { Row { spacing: defaultTextWidth - QGCLabel { text: "Units:" } - QGCLabel { text: fact.units ? fact.units : "none" } + QGCLabel { text: qsTr("Units:") } + QGCLabel { text: fact.units ? fact.units : qsTr("none") } } Row { spacing: defaultTextWidth visible: !fact.minIsDefaultForType - QGCLabel { text: "Minimum value:" } + QGCLabel { text: qsTr("Minimum value:") } QGCLabel { text: fact.minString } } @@ -159,35 +159,35 @@ QGCViewDialog { spacing: defaultTextWidth visible: !fact.maxIsDefaultForType - QGCLabel { text: "Maximum value:" } + QGCLabel { text: qsTr("Maximum value:") } QGCLabel { text: fact.maxString } } Row { spacing: defaultTextWidth - QGCLabel { text: "Default value:" } - QGCLabel { text: fact.defaultValueAvailable ? fact.defaultValueString : "none" } + QGCLabel { text: qsTr("Default value:") } + QGCLabel { text: fact.defaultValueAvailable ? fact.defaultValueString : qsTr("none") } } QGCLabel { width: parent.width wrapMode: Text.WordWrap - text: "Warning: Modifying parameters while vehicle is in flight can lead to vehicle instability and possible vehicle loss. " + - "Make sure you know what you are doing and double-check your values before Save!" + text: qsTr("Warning: Modifying parameters while vehicle is in flight can lead to vehicle instability and possible vehicle loss. ") + + qsTr("Make sure you know what you are doing and double-check your values before Save!") } QGCLabel { id: validationError width: parent.width wrapMode: Text.WordWrap - color: "yellow" + color: qsTr("yellow") } QGCCheckBox { id: forceSave visible: false - text: "Force save (dangerous!)" + text: qsTr("Force save (dangerous!)") } Row { @@ -204,7 +204,7 @@ QGCViewDialog { QGCCheckBox { id: _advanced - text: "Advanced settings" + text: qsTr("Advanced settings") } Rectangle { @@ -216,7 +216,7 @@ QGCViewDialog { } QGCButton { - text: "Set RC to Param..." + text: qsTr("Set RC to Param...") visible: _advanced.checked && !validate && showRCToParam onClicked: controller.setRCToParam(fact.name) } diff --git a/src/QmlControls/QGCMobileFileDialog.qml b/src/QmlControls/QGCMobileFileDialog.qml index 70d947c35..e91ee4435 100644 --- a/src/QmlControls/QGCMobileFileDialog.qml +++ b/src/QmlControls/QGCMobileFileDialog.qml @@ -74,7 +74,7 @@ QGCViewDialog { property alias replaceMessageShown: replaceMessage.visible QGCLabel { - text: "File name:" + text: qsTr("File name:") } QGCTextField { @@ -86,7 +86,7 @@ QGCViewDialog { anchors.left: parent.left anchors.right: parent.right wrapMode: Text.WordWrap - text: "File names must end with ." + fileExtension + " file extension. If missing it will be added." + text: qsTr("File names must end with .%1 file extension. If missing it will be added.").arg(fileExtension) } QGCLabel { @@ -94,7 +94,7 @@ QGCViewDialog { anchors.left: parent.left anchors.right: parent.right wrapMode: Text.WordWrap - text: "The file " + filename + " exists. Click Save again to replace it." + text: qsTr("The file %1 exists. Click Save again to replace it.").arg(filename) visible: false color: qgcPal.warningText } @@ -125,7 +125,7 @@ QGCViewDialog { } QGCLabel { - text: "No files" + text: qsTr("No files") visible: controller.getFiles(fileExtension).length == 0 } } diff --git a/src/QmlControls/QGCView.qml b/src/QmlControls/QGCView.qml index 432a629fb..8a298aabc 100644 --- a/src/QmlControls/QGCView.qml +++ b/src/QmlControls/QGCView.qml @@ -54,61 +54,61 @@ FactPanel { // Accept role buttons if (buttons & StandardButton.Ok) { - __acceptButton.text = "Ok" + __acceptButton.text = qsTr("Ok") __acceptButton.visible = true } else if (buttons & StandardButton.Open) { - __acceptButton.text = "Open" + __acceptButton.text = qsTr("Open") __acceptButton.visible = true } else if (buttons & StandardButton.Save) { - __acceptButton.text = "Save" + __acceptButton.text = qsTr("Save") __acceptButton.visible = true } else if (buttons & StandardButton.Apply) { - __acceptButton.text = "Apply" + __acceptButton.text = qsTr("Apply") __acceptButton.visible = true } else if (buttons & StandardButton.Open) { - __acceptButton.text = "Open" + __acceptButton.text = qsTr("Open") __acceptButton.visible = true } else if (buttons & StandardButton.SaveAll) { - __acceptButton.text = "Save All" + __acceptButton.text = qsTr("Save All") __acceptButton.visible = true } else if (buttons & StandardButton.Yes) { - __acceptButton.text = "Yes" + __acceptButton.text = qsTr("Yes") __acceptButton.visible = true } else if (buttons & StandardButton.YesToAll) { - __acceptButton.text = "Yes to All" + __acceptButton.text = qsTr("Yes to All") __acceptButton.visible = true } else if (buttons & StandardButton.Retry) { - __acceptButton.text = "Retry" + __acceptButton.text = qsTr("Retry") __acceptButton.visible = true } else if (buttons & StandardButton.Reset) { - __acceptButton.text = "Reset" + __acceptButton.text = qsTr("Reset") __acceptButton.visible = true } else if (buttons & StandardButton.RestoreToDefaults) { - __acceptButton.text = "Restore to Defaults" + __acceptButton.text = qsTr("Restore to Defaults") __acceptButton.visible = true } else if (buttons & StandardButton.Ignore) { - __acceptButton.text = "Ignore" + __acceptButton.text = qsTr("Ignore") __acceptButton.visible = true } // Reject role buttons if (buttons & StandardButton.Cancel) { - __rejectButton.text = "Cancel" + __rejectButton.text = qsTr("Cancel") __rejectButton.visible = true } else if (buttons & StandardButton.Close) { - __rejectButton.text = "Close" + __rejectButton.text = qsTr("Close") __rejectButton.visible = true } else if (buttons & StandardButton.No) { - __rejectButton.text = "No" + __rejectButton.text = qsTr("No") __rejectButton.visible = true } else if (buttons & StandardButton.NoToAll) { - __rejectButton.text = "No to All" + __rejectButton.text = qsTr("No to All") __rejectButton.visible = true } else if (buttons & StandardButton.Abort) { - __rejectButton.text = "Abort" + __rejectButton.text = qsTr("Abort") __rejectButton.visible = true } else if (buttons & StandardButton.Reset) { - __rejectButton.text = "Reset" + __rejectButton.text = qsTr("Reset") __rejectButton.visible = true } } @@ -121,7 +121,7 @@ FactPanel { function __checkForEarlyDialog(title) { if (!completedSignalled) { - console.warn("showDialog|Message called before QGCView.completed signalled", title) + console.warn(qsTr("showDialog|Message called before QGCView.completed signalled"), title) } } diff --git a/src/QmlControls/ScreenTools.qml b/src/QmlControls/ScreenTools.qml index 7dd248240..cfd34b068 100644 --- a/src/QmlControls/ScreenTools.qml +++ b/src/QmlControls/ScreenTools.qml @@ -45,7 +45,7 @@ Item { Text { id: _textMeasure - text: "X" + text: qsTr("X") property real fontWidth: contentWidth * (ScreenToolsController.testHighDPI ? 2 : 1) property real fontHeight: contentHeight * (ScreenToolsController.testHighDPI ? 2 : 1) } diff --git a/src/QmlControls/SliderSwitch.qml b/src/QmlControls/SliderSwitch.qml index 6efc773f9..2bc9ef843 100644 --- a/src/QmlControls/SliderSwitch.qml +++ b/src/QmlControls/SliderSwitch.qml @@ -26,7 +26,7 @@ Rectangle { id: label anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter - text: "Slide to " + confirmText + text: qsTr("Slide to %1").arg(confirmText) } Rectangle { diff --git a/src/QtLocationPlugin/QMLControl/OfflineMap.qml b/src/QtLocationPlugin/QMLControl/OfflineMap.qml index e0f88e9df..5b99c3a7e 100644 --- a/src/QtLocationPlugin/QMLControl/OfflineMap.qml +++ b/src/QtLocationPlugin/QMLControl/OfflineMap.qml @@ -153,7 +153,7 @@ Rectangle { text: QGroundControl.mapEngineManager.errorMessage icon: StandardIcon.Critical standardButtons: StandardButton.Ok - title: "Errror Message" + title: qsTr("Errror Message") onYes: { errorDialog.visible = false } @@ -170,13 +170,13 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter QGCLabel { id: labelTitle - text: "Offline Maps" + text: qsTr("Offline Maps") font.pixelSize: ScreenTools.mediumFontPixelSize anchors.verticalCenter: parent.verticalCenter } QGCCheckBox { id: showTilePreview - text: "Show tile min/max zoom level preview" + text: qsTr("Show tile min/max zoom level preview") checked: false visible: _mapView.visible anchors.verticalCenter: parent.verticalCenter @@ -202,7 +202,7 @@ Rectangle { anchors.horizontalCenter: parent.horizontalCenter OfflineMapButton { - text: "Add new set" + text: qsTr("Add new set") anchors.left: parent.left anchors.right: parent.right height: (ScreenTools.defaultFontPixelHeight * 2).toFixed(0) @@ -231,7 +231,7 @@ Rectangle { QGCButton { id: _optionsButton - text: "Options" + text: qsTr("Options") visible: _tileSetList.visible anchors.bottom: parent.bottom anchors.right: parent.right @@ -359,14 +359,14 @@ Rectangle { Column { anchors.verticalCenter: parent.verticalCenter Label { - text: "Min" + text: qsTr("Min") color: "black" width: ScreenTools.defaultFontPixelWidth * 5 font.pixelSize: ScreenTools.smallFontPixelSize horizontalAlignment: Text.AlignHCenter } Label { - text: "Zoom" + text: qsTr("Zoom") color: "black" width: ScreenTools.defaultFontPixelWidth * 5 font.pixelSize: ScreenTools.smallFontPixelSize @@ -423,14 +423,14 @@ Rectangle { Column { anchors.verticalCenter: parent.verticalCenter Label { - text: "Max" + text: qsTr("Max") color: "black" width: ScreenTools.defaultFontPixelWidth * 5 font.pixelSize: ScreenTools.smallFontPixelSize horizontalAlignment: Text.AlignHCenter } Label { - text: "Zoom" + text: qsTr("Zoom") color: "black" width: ScreenTools.defaultFontPixelWidth * 5 font.pixelSize: ScreenTools.smallFontPixelSize @@ -485,7 +485,7 @@ Rectangle { spacing: ScreenTools.defaultFontPixelHeight * 0.5 anchors.verticalCenter: parent.verticalCenter Label { - text: "Tile Count" + text: qsTr("Tile Count") color: "black" width: ScreenTools.defaultFontPixelWidth * 12 font.pixelSize: ScreenTools.smallFontPixelSize @@ -498,7 +498,7 @@ Rectangle { horizontalAlignment: Text.AlignHCenter } Label { - text: "Set Size (Est)" + text: qsTr("Set Size (Est)") color: "black" width: ScreenTools.defaultFontPixelWidth * 12 font.pixelSize: ScreenTools.smallFontPixelSize @@ -519,7 +519,7 @@ Rectangle { Row { spacing: ScreenTools.defaultFontPixelWidth * 2 QGCLabel { - text: "Name:" + text: qsTr("Name:") width: ScreenTools.defaultFontPixelWidth * 10 anchors.verticalCenter: parent.verticalCenter horizontalAlignment: Text.AlignRight @@ -533,14 +533,14 @@ Rectangle { Row { spacing: ScreenTools.defaultFontPixelWidth * 2 QGCLabel { - text: "Description:" + text: qsTr("Description:") width: ScreenTools.defaultFontPixelWidth * 10 anchors.verticalCenter: parent.verticalCenter horizontalAlignment: Text.AlignRight } QGCTextField { id: setDescription - text: "Description" + text: qsTr("Description") width: ScreenTools.defaultFontPixelWidth * 24 anchors.verticalCenter: parent.verticalCenter } @@ -548,7 +548,7 @@ Rectangle { Row { spacing: ScreenTools.defaultFontPixelWidth * 2 QGCLabel { - text: "Map Type:" + text: qsTr("Map Type:") width: ScreenTools.defaultFontPixelWidth * 10 anchors.verticalCenter: parent.verticalCenter horizontalAlignment: Text.AlignRight @@ -566,7 +566,7 @@ Rectangle { Component.onCompleted: { var index = mapCombo.find(mapType) if (index === -1) { - console.warn("Active map name not in combo", mapType) + console.warn(qsTr("Active map name not in combo"), mapType) } else { mapCombo.currentIndex = index } @@ -582,7 +582,7 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter spacing: ScreenTools.defaultFontPixelHeight * 0.5 QGCButton { - text: "Download" + text: qsTr("Download") enabled: setName.text.length > 0 width: ScreenTools.defaultFontPixelWidth * 10 onClicked: { @@ -600,7 +600,7 @@ Rectangle { } } QGCButton { - text: "Cancel" + text: qsTr("Cancel") width: ScreenTools.defaultFontPixelWidth * 10 onClicked: { showList() @@ -611,8 +611,8 @@ Rectangle { visible: false icon: StandardIcon.Warning standardButtons: StandardButton.Ok - title: "Tile Set Already Exists" - text: "Tile Set \"" + setName.text + "\" already exists.\nPlease select a different name." + title: qsTr("Tile Set Already Exists") + text: qsTr("Tile Set \"%1\" already exists.\nPlease select a different name.").arg(setName.text) onYes: { duplicateName.visible = false } @@ -676,7 +676,7 @@ Rectangle { rowSpacing: ScreenTools.defaultFontPixelWidth columnSpacing: ScreenTools.defaultFontPixelHeight * 2 QGCLabel { - text: "Map Type:" + text: qsTr("Map Type:") visible: !isDefaultSet } QGCLabel { @@ -684,7 +684,7 @@ Rectangle { visible: !isDefaultSet } QGCLabel { - text: "Min Zoom:" + text: qsTr("Min Zoom:") visible: !isDefaultSet } QGCLabel { @@ -692,7 +692,7 @@ Rectangle { visible: !isDefaultSet } QGCLabel { - text: "Max Zoom:" + text: qsTr("Max Zoom:") visible: !isDefaultSet } QGCLabel { @@ -700,31 +700,31 @@ Rectangle { visible: !isDefaultSet } QGCLabel { - text: isDefaultSet ? "Default Set Size:" : "Total Size:" + text: isDefaultSet ? qsTr("Default Set Size:") : qsTr("Total Size:") } QGCLabel { text: _offlineMapRoot._currentSelection ? _offlineMapRoot._currentSelection.tilesSizeStr : "" } QGCLabel { - text: isDefaultSet ? "Default Set Tile Count:" : "Total Tile Count:" + text: isDefaultSet ? qsTr("Default Set Tile Count:") : qsTr("Total Tile Count:") } QGCLabel { text: _offlineMapRoot._currentSelection ? _offlineMapRoot._currentSelection.numTilesStr : "" } QGCLabel { - text: isDefaultSet ? "Total Size (All Sets):" : "Downloaded Size:" + text: isDefaultSet ? qsTr("Total Size (All Sets):") : qsTr("Downloaded Size:") } QGCLabel { text: _offlineMapRoot._currentSelection ? _offlineMapRoot._currentSelection.savedSizeStr : "" } QGCLabel { - text: isDefaultSet ? "Total Count (All Sets):" : "Downloaded Count:" + text: isDefaultSet ? qsTr("Total Count (All Sets):") : qsTr("Downloaded Count:") } QGCLabel { text: _offlineMapRoot._currentSelection ? _offlineMapRoot._currentSelection.savedTilesStr : "" } QGCLabel { - text: "Error Count:" + text: qsTr("Error Count:") visible: !isDefaultSet && _offlineMapRoot._currentSelection && !_offlineMapRoot._currentSelection.complete } QGCLabel { @@ -742,7 +742,7 @@ Rectangle { spacing: ScreenTools.defaultFontPixelWidth QGCButton { width: ScreenTools.defaultFontPixelWidth * 18 - text: "Delete" + text: qsTr("Delete") enabled: _offlineMapRoot._currentSelection && (!_offlineMapRoot._currentSelection.deleting) onClicked: { if(_offlineMapRoot._currentSelection) @@ -753,12 +753,12 @@ Rectangle { visible: false icon: StandardIcon.Warning standardButtons: StandardButton.Yes | StandardButton.No - title: "Delete Tile Set" + title: qsTr("Delete Tile Set") text: { if(_offlineMapRoot._currentSelection) { - var blurb = "Delete " + _offlineMapRoot._currentSelection.name + " and all its tiles.\nIs this really what you want?" + var blurb = qsTr("Delete %1 and all its tiles.\nIs this really what you want?").arg(_offlineMapRoot._currentSelection.name) if(_offlineMapRoot._currentSelection.defaultSet) - return blurb + "\nNote that deleteting the Default Set deletes all tiles from all sets." + return blurb + qsTr("\nNote that deleteting the Default Set deletes all tiles from all sets.") else return blurb } @@ -776,7 +776,7 @@ Rectangle { } } QGCButton { - text: "Resume Download" + text: qsTr("Resume Download") width: ScreenTools.defaultFontPixelWidth * 18 enabled: _offlineMapRoot._currentSelection && (!_offlineMapRoot._currentSelection.deleting && !_offlineMapRoot._currentSelection.downloading) visible: !isDefaultSet && _offlineMapRoot._currentSelection && (!_offlineMapRoot._currentSelection.complete && !_offlineMapRoot._currentSelection.downloading) @@ -786,7 +786,7 @@ Rectangle { } } QGCButton { - text: "Cancel Download" + text: qsTr("Cancel Download") width: ScreenTools.defaultFontPixelWidth * 18 enabled: _offlineMapRoot._currentSelection && (!_offlineMapRoot._currentSelection.deleting && _offlineMapRoot._currentSelection.downloading) visible: !isDefaultSet && _offlineMapRoot._currentSelection && (!_offlineMapRoot._currentSelection.complete && _offlineMapRoot._currentSelection.downloading) @@ -796,7 +796,7 @@ Rectangle { } } QGCButton { - text: "Back" + text: qsTr("Back") width: ScreenTools.defaultFontPixelWidth * 18 onClicked: showList() } @@ -861,7 +861,7 @@ Rectangle { rowSpacing: ScreenTools.defaultFontPixelWidth * 1.5 columnSpacing: ScreenTools.defaultFontPixelHeight * 2 QGCLabel { - text: "Max Cache Disk Size (MB):" + text: qsTr("Max Cache Disk Size (MB):") } QGCTextField { id: maxCacheSize @@ -870,7 +870,7 @@ Rectangle { validator: IntValidator {bottom: 1; top: 262144;} } QGCLabel { - text: "Max Cache Memory Size (MB):" + text: qsTr("Max Cache Memory Size (MB):") } QGCTextField { id: maxCacheMemSize @@ -884,7 +884,7 @@ Rectangle { implicitHeight: ScreenTools.defaultFontPixelHeight * 1.5 QGCLabel { anchors.centerIn: parent - text: "Memory cache changes require a restart to take effect." + text: qsTr("Memory cache changes require a restart to take effect.") font.pixelSize: ScreenTools.defaultFontPixelSize * 0.85 } } @@ -895,7 +895,7 @@ Rectangle { color: qgcPal.text } QGCLabel { - text: "MapBox Access Token" + text: qsTr("MapBox Access Token") } QGCTextField { id: mapBoxToken @@ -909,7 +909,7 @@ Rectangle { implicitHeight: ScreenTools.defaultFontPixelHeight * 1.5 QGCLabel { anchors.centerIn: parent - text: "With an access token, you can use MapBox Maps." + text: qsTr("With an access token, you can use MapBox Maps.") font.pixelSize: ScreenTools.defaultFontPixelSize * 0.85 } } @@ -919,7 +919,7 @@ Rectangle { anchors.horizontalCenter: parent.horizontalCenter spacing: ScreenTools.defaultFontPixelWidth QGCButton { - text: "Save" + text: qsTr("Save") width: ScreenTools.defaultFontPixelWidth * 18 onClicked: { QGroundControl.mapEngineManager.mapboxToken = mapBoxToken.text @@ -929,7 +929,7 @@ Rectangle { } } QGCButton { - text: "Cancel" + text: qsTr("Cancel") width: ScreenTools.defaultFontPixelWidth * 18 onClicked: { showList() -- 2.22.0