Browse Source

Fix translatability of caution message

Never put the formatting within the i18nc call. Always put the formatted string inside, but the formatting call outside of the function, like this:

    catalog.i18nc('@info', 'I am {age} years old.').format(age = my_age)

Otherwise, when looking up the translation for the string, it's going to try to look up the translation for the formatted string (with the age already filled in). It won't be able to find that because this sentence was not translated for all possible ages of a human.
In this case I can make it even easier on the translator because the list must always follow after the text.
Ghostkeeper 5 years ago
parent
commit
02b0242807
1 changed files with 2 additions and 3 deletions
  1. 2 3
      cura/Settings/MachineManager.py

+ 2 - 3
cura/Settings/MachineManager.py

@@ -921,9 +921,8 @@ class MachineManager(QObject):
             # Apply quality changes that are incompatible to user changes, so we do not change the quality changes itself.
             self._global_container_stack.userChanges.setProperty(setting_key, "value", self._default_extruder_position)
         if add_user_changes:
-            caution_message = Message(catalog.i18nc(
-                "@info:generic",
-                "Settings have been changed to match the current availability of extruders: [%s]" % ", ".join(add_user_changes)),
+            caution_message = Message(
+                catalog.i18nc("@info:message Followed by a list of settings.", "Settings have been changed to match the current availability of extruders:") + " [{settings_list}]".format(settings_list = ", ".join(add_user_changes)),
                 lifetime = 0,
                 title = catalog.i18nc("@info:title", "Settings updated"))
             caution_message.show()