From a3b6ced5e595fa47555bf3b89821a59393767df4 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 18 Sep 2017 15:30:40 +0200 Subject: [PATCH 1/3] Changed titles of unable to slice messages This makes it a bit clearer what is going on and what the "source" of the message is. CURA-4332 --- plugins/CuraEngineBackend/CuraEngineBackend.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index d642fdfe08..dd5b182607 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -266,7 +266,7 @@ class CuraEngineBackend(QObject, Backend): if job.getResult() == StartSliceJob.StartJobResult.MaterialIncompatible: if Application.getInstance().platformActivity: self._error_message = Message(catalog.i18nc("@info:status", - "The selected material is incompatible with the selected machine or configuration."), title = catalog.i18nc("@info:title", "Incompatible material")) + "Unable to slice with the current material as it is incompatible with the selected machine or configuration."), title = catalog.i18nc("@info:title", "Unable to slice")) self._error_message.show() self.backendStateChange.emit(BackendState.Error) else: @@ -294,7 +294,7 @@ class CuraEngineBackend(QObject, Backend): error_labels = ", ".join(error_labels) self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice with the current settings. The following settings have errors: {0}".format(error_labels)), - title = catalog.i18nc("@info:title", "Invalid settings")) + title = catalog.i18nc("@info:title", "Unable to slice")) self._error_message.show() self.backendStateChange.emit(BackendState.Error) else: @@ -304,7 +304,7 @@ class CuraEngineBackend(QObject, Backend): if job.getResult() == StartSliceJob.StartJobResult.BuildPlateError: if Application.getInstance().platformActivity: self._error_message = Message(catalog.i18nc("@info:status", "Unable to slice because the prime tower or prime position(s) are invalid."), - title = catalog.i18nc("@info:title", "Invalid position")) + title = catalog.i18nc("@info:title", "Unable to slice")) self._error_message.show() self.backendStateChange.emit(BackendState.Error) else: @@ -313,7 +313,7 @@ class CuraEngineBackend(QObject, Backend): if job.getResult() == StartSliceJob.StartJobResult.NothingToSlice: if Application.getInstance().platformActivity: self._error_message = Message(catalog.i18nc("@info:status", "Nothing to slice because none of the models fit the build volume. Please scale or rotate models to fit."), - title = catalog.i18nc("@info:title", "Warning")) + title = catalog.i18nc("@info:title", "Unable to slice")) self._error_message.show() self.backendStateChange.emit(BackendState.Error) else: From 315042016069f2476009e6c85735e1f1273ba462 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 18 Sep 2017 17:01:15 +0200 Subject: [PATCH 2/3] Fix i18n with replaced texts Also added a description for the translator. Contributes to issue CURA-4341. --- .../FirmwareUpdateCheckerJob.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py index 31ce137ed7..01b6f1ab3a 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py @@ -68,12 +68,13 @@ class FirmwareUpdateCheckerJob(Job): # notify the user when no new firmware version is available. if (checked_version != "") and (checked_version != current_version): Logger.log("i", "SHOWING FIRMWARE UPDATE MESSAGE") - message = Message(i18n_catalog.i18nc("@info", "To ensure that your %s is equipped with the latest " - "features it is recommended to update the firmware " - "regularly. This can be done on the %s (when connected " - "to the network) or via USB." - % (machine_name, machine_name)), - title = i18n_catalog.i18nc("@info:title", "New %s firmware available" % machine_name)) + message = Message(i18n_catalog.i18nc("@info Both %s get replaced with the printer name.", + "To ensure that your %s is equipped with the latest " + "features it is recommended to update the firmware " + "regularly. This can be done on the %s (when connected " + "to the network) or via USB.") + % (machine_name, machine_name), + title = i18n_catalog.i18nc("@info:title The %s gets replaced with the printer name.", "New %s firmware available") % machine_name) message.addAction("download", i18n_catalog.i18nc("@action:button", "Download"), "[no_icon]", "[no_description]") # If we do this in a cool way, the download url should be available in the JSON file From 0060909117cc0fea709db65649f4b1267bd94f8c Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 18 Sep 2017 17:13:01 +0200 Subject: [PATCH 3/3] Use named arguments for i18n string Otherwise the i18n system can't figure out which %s belongs to which parameter. Contributes to issue CURA-4341. --- plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py index 01b6f1ab3a..93cf14bddf 100644 --- a/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py +++ b/plugins/FirmwareUpdateChecker/FirmwareUpdateCheckerJob.py @@ -68,12 +68,7 @@ class FirmwareUpdateCheckerJob(Job): # notify the user when no new firmware version is available. if (checked_version != "") and (checked_version != current_version): Logger.log("i", "SHOWING FIRMWARE UPDATE MESSAGE") - message = Message(i18n_catalog.i18nc("@info Both %s get replaced with the printer name.", - "To ensure that your %s is equipped with the latest " - "features it is recommended to update the firmware " - "regularly. This can be done on the %s (when connected " - "to the network) or via USB.") - % (machine_name, machine_name), + message = Message(i18n_catalog.i18nc("@info Don't translate {machine_name}, since it gets replaced by a printer name!", "To ensure that your {machine_name} is equipped with the latest features it is recommended to update the firmware regularly. This can be done on the {machine_name} (when connected to the network) or via USB.").format(machine_name = machine_name), title = i18n_catalog.i18nc("@info:title The %s gets replaced with the printer name.", "New %s firmware available") % machine_name) message.addAction("download", i18n_catalog.i18nc("@action:button", "Download"), "[no_icon]", "[no_description]")