From 7ab6a551c1832ad593c4238fd02cdaf202608a85 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 14 Aug 2017 13:54:11 +0200 Subject: [PATCH] Clarify that XML material tags don't get translated Some of the translators got this wrong last time. Let's see how good they read this next time... Contributes to issue CURA-4113. --- cura/Settings/CuraContainerRegistry.py | 14 +++++++------- .../RemovableDriveOutputDevice.py | 6 +++--- resources/qml/Preferences/MaterialsPage.qml | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cura/Settings/CuraContainerRegistry.py b/cura/Settings/CuraContainerRegistry.py index c991c8f9ca..09c17d3344 100644 --- a/cura/Settings/CuraContainerRegistry.py +++ b/cura/Settings/CuraContainerRegistry.py @@ -140,15 +140,15 @@ class CuraContainerRegistry(ContainerRegistry): success = profile_writer.write(file_name, found_containers) except Exception as e: Logger.log("e", "Failed to export profile to %s: %s", file_name, str(e)) - m = Message(catalog.i18nc("@info:status", "Failed to export profile to {0}: {1}", file_name, str(e)), lifetime = 0) + m = Message(catalog.i18nc("@info:status Don't translate the XML tags or !", "Failed to export profile to {0}: {1}", file_name, str(e)), lifetime = 0) m.show() return if not success: Logger.log("w", "Failed to export profile to %s: Writer plugin reported failure.", file_name) - m = Message(catalog.i18nc("@info:status", "Failed to export profile to {0}: Writer plugin reported failure.", file_name), lifetime = 0) + m = Message(catalog.i18nc("@info:status Don't translate the XML tag !", "Failed to export profile to {0}: Writer plugin reported failure.", file_name), lifetime = 0) m.show() return - m = Message(catalog.i18nc("@info:status", "Exported profile to {0}", file_name)) + m = Message(catalog.i18nc("@info:status Don't translate the XML tag !", "Exported profile to {0}", file_name)) m.show() ## Gets the plugin object matching the criteria @@ -174,7 +174,7 @@ class CuraContainerRegistry(ContainerRegistry): def importProfile(self, file_name): Logger.log("d", "Attempting to import profile %s", file_name) if not file_name: - return { "status": "error", "message": catalog.i18nc("@info:status", "Failed to import profile from {0}: {1}", file_name, "Invalid path")} + return { "status": "error", "message": catalog.i18nc("@info:status Don't translate the XML tags or !", "Failed to import profile from {0}: {1}", file_name, "Invalid path")} plugin_registry = PluginRegistry.getInstance() extension = file_name.split(".")[-1] @@ -196,7 +196,7 @@ class CuraContainerRegistry(ContainerRegistry): except Exception as e: # Note that this will fail quickly. That is, if any profile reader throws an exception, it will stop reading. It will only continue reading if the reader returned None. Logger.log("e", "Failed to import profile from %s: %s while using profile reader. Got exception %s", file_name,profile_reader.getPluginId(), str(e)) - return { "status": "error", "message": catalog.i18nc("@info:status", "Failed to import profile from {0}: {1}", file_name, str(e))} + return { "status": "error", "message": catalog.i18nc("@info:status Don't translate the XML tags or !", "Failed to import profile from {0}: {1}", file_name, str(e))} if profile_or_list: # Success! name_seed = os.path.splitext(os.path.basename(file_name))[0] new_name = self.uniqueName(name_seed) @@ -205,7 +205,7 @@ class CuraContainerRegistry(ContainerRegistry): result = self._configureProfile(profile, name_seed, new_name) if result is not None: - return {"status": "error", "message": catalog.i18nc("@info:status", "Failed to import profile from {0}: {1}", file_name, result)} + return {"status": "error", "message": catalog.i18nc("@info:status Don't translate the XML tags or !", "Failed to import profile from {0}: {1}", file_name, result)} return {"status": "ok", "message": catalog.i18nc("@info:status", "Successfully imported profile {0}", profile.getName())} else: @@ -239,7 +239,7 @@ class CuraContainerRegistry(ContainerRegistry): result = self._configureProfile(profile, profile_id, new_name) if result is not None: - return {"status": "error", "message": catalog.i18nc("@info:status", "Failed to import profile from {0}: {1}", file_name, result)} + return {"status": "error", "message": catalog.i18nc("@info:status Don't translate the XML tags or !", "Failed to import profile from {0}: {1}", file_name, result)} profile_index += 1 diff --git a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py index c5c18f9709..f7adef9a3f 100644 --- a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py +++ b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py @@ -86,7 +86,7 @@ class RemovableDriveOutputDevice(OutputDevice): job.progress.connect(self._onProgress) job.finished.connect(self._onFinished) - message = Message(catalog.i18nc("@info:progress", "Saving to Removable Drive {0}").format(self.getName()), 0, False, -1) + message = Message(catalog.i18nc("@info:progress Don't translate the XML tags !", "Saving to Removable Drive {0}").format(self.getName()), 0, False, -1) message.show() self.writeStarted.emit(self) @@ -96,10 +96,10 @@ class RemovableDriveOutputDevice(OutputDevice): job.start() except PermissionError as e: Logger.log("e", "Permission denied when trying to write to %s: %s", file_name, str(e)) - raise OutputDeviceError.PermissionDeniedError(catalog.i18nc("@info:status", "Could not save to {0}: {1}").format(file_name, str(e))) from e + raise OutputDeviceError.PermissionDeniedError(catalog.i18nc("@info:status Don't translate the XML tags or !", "Could not save to {0}: {1}").format(file_name, str(e))) from e except OSError as e: Logger.log("e", "Operating system would not let us write to %s: %s", file_name, str(e)) - raise OutputDeviceError.WriteRequestFailedError(catalog.i18nc("@info:status", "Could not save to {0}: {1}").format(file_name, str(e))) from e + raise OutputDeviceError.WriteRequestFailedError(catalog.i18nc("@info:status Don't translate the XML tags or !", "Could not save to {0}: {1}").format(file_name, str(e))) from e ## Generate a file name automatically for the specified nodes to be saved # in. diff --git a/resources/qml/Preferences/MaterialsPage.qml b/resources/qml/Preferences/MaterialsPage.qml index 0f51c121fe..13b33b1ea1 100644 --- a/resources/qml/Preferences/MaterialsPage.qml +++ b/resources/qml/Preferences/MaterialsPage.qml @@ -317,11 +317,11 @@ UM.ManagementPage var result = Cura.ContainerManager.importContainer(fileUrl) messageDialog.title = catalog.i18nc("@title:window", "Import Material") - messageDialog.text = catalog.i18nc("@info:status", "Could not import material %1: %2").arg(fileUrl).arg(result.message) + messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags or !", "Could not import material %1: %2").arg(fileUrl).arg(result.message) if(result.status == "success") { messageDialog.icon = StandardIcon.Information - messageDialog.text = catalog.i18nc("@info:status", "Successfully imported material %1").arg(fileUrl) + messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag !", "Successfully imported material %1").arg(fileUrl) currentItem = base.model.getItem(base.objectList.currentIndex) } else if(result.status == "duplicate") @@ -359,13 +359,13 @@ UM.ManagementPage if(result.status == "error") { messageDialog.icon = StandardIcon.Critical - messageDialog.text = catalog.i18nc("@info:status", "Failed to export material to %1: %2").arg(fileUrl).arg(result.message) + messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tags and !", "Failed to export material to %1: %2").arg(fileUrl).arg(result.message) messageDialog.open() } else if(result.status == "success") { messageDialog.icon = StandardIcon.Information - messageDialog.text = catalog.i18nc("@info:status", "Successfully exported material to %1").arg(result.path) + messageDialog.text = catalog.i18nc("@info:status Don't translate the XML tag !", "Successfully exported material to %1").arg(result.path) messageDialog.open() } CuraApplication.setDefaultPath("dialog_material_path", folder)