From 02b0242807c87d82e4caec4bbce98bfae21e8af9 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 14 Jun 2019 11:00:52 +0200 Subject: [PATCH] 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. --- cura/Settings/MachineManager.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 643844392c..3366d67d25 100755 --- a/cura/Settings/MachineManager.py +++ b/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()