Browse Source

Improvements to translated strings

These strings were recently found to have been confusing to the translators. Improvements are:
- Pulling the (untranslated) error message out of the message sentence. We really want the error message to be at the end so we'll force the translators to translate it as a prefix.
- Remove extra spaces at the end.
- Remove Python logic from within the i18nc call, since gettext doesn't understand that.

Contributes to issue CURA-5741.
Ghostkeeper 6 years ago
parent
commit
314b966cc9

+ 8 - 9
cura/Settings/CuraContainerRegistry.py

@@ -187,11 +187,11 @@ class CuraContainerRegistry(ContainerRegistry):
             try:
                 profile_or_list = profile_reader.read(file_name)  # Try to open the file with the profile reader.
             except NoProfileException:
-                return { "status": "ok", "message": catalog.i18nc("@info:status Don't translate the XML tags <filename> or <message>!", "No custom profile to import in file <filename>{0}</filename>", file_name)}
+                return { "status": "ok", "message": catalog.i18nc("@info:status Don't translate the XML tags <filename>!", "No custom profile to import in file <filename>{0}</filename>", file_name)}
             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 Don't translate the XML tags <filename> or <message>!", "Failed to import profile from <filename>{0}</filename>: <message>{1}</message>", file_name, "\n" + str(e))}
+                return { "status": "error", "message": catalog.i18nc("@info:status Don't translate the XML tags <filename>!", "Failed to import profile from <filename>{0}</filename>:", file_name) + "\n<message>" + str(e) + "</message>"}
 
             if profile_or_list:
                 # Ensure it is always a list of profiles
@@ -215,7 +215,7 @@ class CuraContainerRegistry(ContainerRegistry):
                 if not global_profile:
                     Logger.log("e", "Incorrect profile [%s]. Could not find global profile", file_name)
                     return { "status": "error",
-                             "message": catalog.i18nc("@info:status Don't translate the XML tags <filename> or <message>!", "This profile <filename>{0}</filename> contains incorrect data, could not import it.", file_name)}
+                             "message": catalog.i18nc("@info:status Don't translate the XML tags <filename>!", "This profile <filename>{0}</filename> contains incorrect data, could not import it.", file_name)}
                 profile_definition = global_profile.getMetaDataEntry("definition")
 
                 # Make sure we have a profile_definition in the file:
@@ -225,7 +225,7 @@ class CuraContainerRegistry(ContainerRegistry):
                 if not machine_definition:
                     Logger.log("e", "Incorrect profile [%s]. Unknown machine type [%s]", file_name, profile_definition)
                     return {"status": "error",
-                            "message": catalog.i18nc("@info:status Don't translate the XML tags <filename> or <message>!", "This profile <filename>{0}</filename> contains incorrect data, could not import it.", file_name)
+                            "message": catalog.i18nc("@info:status Don't translate the XML tags <filename>!", "This profile <filename>{0}</filename> contains incorrect data, could not import it.", file_name)
                             }
                 machine_definition = machine_definition[0]
 
@@ -238,7 +238,7 @@ class CuraContainerRegistry(ContainerRegistry):
                 if profile_definition != expected_machine_definition:
                     Logger.log("e", "Profile [%s] is for machine [%s] but the current active machine is [%s]. Will not import the profile", file_name, profile_definition, expected_machine_definition)
                     return { "status": "error",
-                             "message": catalog.i18nc("@info:status Don't translate the XML tags <filename> or <message>!", "The machine defined in profile <filename>{0}</filename> ({1}) doesn't match with your current machine ({2}), could not import it.", file_name, profile_definition, expected_machine_definition)}
+                             "message": catalog.i18nc("@info:status Don't translate the XML tags <filename>!", "The machine defined in profile <filename>{0}</filename> ({1}) doesn't match with your current machine ({2}), could not import it.", file_name, profile_definition, expected_machine_definition)}
 
                 # Fix the global quality profile's definition field in case it's not correct
                 global_profile.setMetaDataEntry("definition", expected_machine_definition)
@@ -269,8 +269,7 @@ class CuraContainerRegistry(ContainerRegistry):
                         if idx == 0:
                             # move all per-extruder settings to the first extruder's quality_changes
                             for qc_setting_key in global_profile.getAllKeys():
-                                settable_per_extruder = global_stack.getProperty(qc_setting_key,
-                                                                                           "settable_per_extruder")
+                                settable_per_extruder = global_stack.getProperty(qc_setting_key, "settable_per_extruder")
                                 if settable_per_extruder:
                                     setting_value = global_profile.getProperty(qc_setting_key, "value")
 
@@ -310,8 +309,8 @@ class CuraContainerRegistry(ContainerRegistry):
                     if result is not None:
                         return {"status": "error", "message": catalog.i18nc(
                             "@info:status Don't translate the XML tags <filename> or <message>!",
-                            "Failed to import profile from <filename>{0}</filename>: <message>{1}</message>",
-                            file_name, result)}
+                            "Failed to import profile from <filename>{0}</filename>:",
+                            file_name) + " <message>" + result + "</message>"}
 
                 return {"status": "ok", "message": catalog.i18nc("@info:status", "Successfully imported profile {0}", profile_or_list[0].getName())}
 

+ 5 - 5
plugins/ImageReader/ConfigUI.qml

@@ -35,7 +35,7 @@ UM.Dialog
                 width: parent.width
 
                 Label {
-                    text: catalog.i18nc("@action:label","Height (mm)")
+                    text: catalog.i18nc("@action:label", "Height (mm)")
                     width: 150 * screenScaleFactor
                     anchors.verticalCenter: parent.verticalCenter
                 }
@@ -58,7 +58,7 @@ UM.Dialog
                 width: parent.width
 
                 Label {
-                    text: catalog.i18nc("@action:label","Base (mm)")
+                    text: catalog.i18nc("@action:label", "Base (mm)")
                     width: 150 * screenScaleFactor
                     anchors.verticalCenter: parent.verticalCenter
                 }
@@ -81,7 +81,7 @@ UM.Dialog
                 width: parent.width
 
                 Label {
-                    text: catalog.i18nc("@action:label","Width (mm)")
+                    text: catalog.i18nc("@action:label", "Width (mm)")
                     width: 150 * screenScaleFactor
                     anchors.verticalCenter: parent.verticalCenter
                 }
@@ -105,7 +105,7 @@ UM.Dialog
                 width: parent.width
 
                 Label {
-                    text: catalog.i18nc("@action:label","Depth (mm)")
+                    text: catalog.i18nc("@action:label", "Depth (mm)")
                     width: 150 * screenScaleFactor
                     anchors.verticalCenter: parent.verticalCenter
                 }
@@ -151,7 +151,7 @@ UM.Dialog
                 width: parent.width
 
                 Label {
-                    text: catalog.i18nc("@action:label","Smoothing")
+                    text: catalog.i18nc("@action:label", "Smoothing")
                     width: 150 * screenScaleFactor
                     anchors.verticalCenter: parent.verticalCenter
                 }

+ 1 - 1
plugins/Toolbox/resources/qml/ToolboxConfirmUninstallResetDialog.qml

@@ -17,7 +17,7 @@ UM.Dialog
     // This dialog asks the user whether he/she wants to open a project file as a project or import models.
     id: base
 
-    title: catalog.i18nc("@title:window", "Confirm uninstall ") + toolbox.pluginToUninstall
+    title: catalog.i18nc("@title:window", "Confirm uninstall") + toolbox.pluginToUninstall
     width: 450 * screenScaleFactor
     height: 50 * screenScaleFactor + dialogText.height + buttonBar.height
 

+ 1 - 2
plugins/UM3NetworkPrinting/src/LegacyUM3OutputDevice.py

@@ -100,8 +100,7 @@ class LegacyUM3OutputDevice(NetworkedPrinterOutputDevice):
                                                          title=i18n_catalog.i18nc("@info:title",
                                                                                   "Authentication status"))
 
-        self._authentication_failed_message = Message(i18n_catalog.i18nc("@info:status", ""),
-                                                      title=i18n_catalog.i18nc("@info:title", "Authentication Status"))
+        self._authentication_failed_message = Message("", title=i18n_catalog.i18nc("@info:title", "Authentication Status"))
         self._authentication_failed_message.addAction("Retry", i18n_catalog.i18nc("@action:button", "Retry"), None,
                                                       i18n_catalog.i18nc("@info:tooltip", "Re-send the access request"))
         self._authentication_failed_message.actionTriggered.connect(self._messageCallback)

+ 1 - 1
resources/qml/WorkspaceSummaryDialog.qml

@@ -117,7 +117,7 @@ UM.Dialog
                         height: childrenRect.height
                         Label
                         {
-                            text: catalog.i18nc("@action:label", Cura.MachineManager.activeMachineNetworkGroupName != "" ? "Printer Group" : "Name")
+                            text: Cura.MachineManager.activeMachineNetworkGroupName != "" ? catalog.i18nc("@action:label", "Printer Group") : catalog.i18nc("@action:label", "Name")
                             width: Math.floor(scroll.width / 3) | 0
                         }
                         Label