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.
This commit is contained in:
Ghostkeeper 2019-06-14 11:00:52 +02:00
parent 52ed79805e
commit 02b0242807
No known key found for this signature in database
GPG Key ID: 86BEF881AE2CF276

View File

@ -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. # 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) self._global_container_stack.userChanges.setProperty(setting_key, "value", self._default_extruder_position)
if add_user_changes: if add_user_changes:
caution_message = Message(catalog.i18nc( caution_message = Message(
"@info:generic", 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)),
"Settings have been changed to match the current availability of extruders: [%s]" % ", ".join(add_user_changes)),
lifetime = 0, lifetime = 0,
title = catalog.i18nc("@info:title", "Settings updated")) title = catalog.i18nc("@info:title", "Settings updated"))
caution_message.show() caution_message.show()