Move some HTML codes out of the translation

Due to string freeze we can't fix this for 4.7

CURA-7627
This commit is contained in:
Jaime van Kessel 2020-08-04 13:44:33 +02:00
parent a8904e76b0
commit c8746eced6
No known key found for this signature in database
GPG key ID: 3710727397403C91

View file

@ -332,11 +332,12 @@ class CloudOutputDeviceManager:
"These printers are not linked to the Digital Factory:", "These printers are not linked to the Digital Factory:",
len(self.reported_device_ids) len(self.reported_device_ids)
) )
message_text += "<br/><ul>{}</ul><br/>".format(device_names)
digital_factory_string = self.I18N_CATALOG.i18nc("info:name", "Ultimaker Digital Factory")
message_text += self.I18N_CATALOG.i18nc( message_text += self.I18N_CATALOG.i18nc(
"info:status", "info:status",
"<ul>{}</ul>To establish a connection, please visit the " "To establish a connection, please visit the {website_link}".format(website_link = "<a href='https://digitalfactory.ultimaker.com/'>{}</a>.".format(digital_factory_string))
"<a href='https://mycloud.ultimaker.com/'>Ultimaker Digital Factory</a>.",
device_names
) )
self._removed_printers_message.setText(message_text) self._removed_printers_message.setText(message_text)
self._removed_printers_message.addAction("keep_printer_configurations_action", self._removed_printers_message.addAction("keep_printer_configurations_action",
@ -422,13 +423,17 @@ class CloudOutputDeviceManager:
machine.setMetaDataEntry(self.META_HOST_GUID, device.clusterData.host_guid) machine.setMetaDataEntry(self.META_HOST_GUID, device.clusterData.host_guid)
machine.setMetaDataEntry("group_name", device.name) machine.setMetaDataEntry("group_name", device.name)
machine.setMetaDataEntry("group_size", device.clusterSize) machine.setMetaDataEntry("group_size", device.clusterSize)
machine.setMetaDataEntry("removal_warning", self.I18N_CATALOG.i18nc( digital_factory_string = self.I18N_CATALOG.i18nc("info:name", "Ultimaker Digital Factory")
"@label ({} is printer name)", digital_factory_link = "<a href='https://digitalfactory.ultimaker.com/'>{}</a>".format(digital_factory_string)
"{} will be removed until the next account sync. <br> To remove {} permanently, " removal_warning_string = self.I18N_CATALOG.i18nc(
"visit <a href='https://mycloud.ultimaker.com/'>Ultimaker Digital Factory</a>. " "@label ({printer_name} is replaced with the name of the printer",
"<br><br>Are you sure you want to remove {} temporarily?", "{printer_name} will be removed until the next account sync. <br> To remove {printer_name} permanently, "
device.name, device.name, device.name "visit {digital_factory_link}"
)) "<br><br>Are you sure you want to remove {printer_name} temporarily?".format(printer_name = device.name,
digital_factory_link = digital_factory_link)
)
machine.setMetaDataEntry("removal_warning", removal_warning_string)
machine.addConfiguredConnectionType(device.connectionType.value) machine.addConfiguredConnectionType(device.connectionType.value)
def _connectToOutputDevice(self, device: CloudOutputDevice, machine: GlobalStack) -> None: def _connectToOutputDevice(self, device: CloudOutputDevice, machine: GlobalStack) -> None: