Make generated extruder options translateable

These do appear in the actual interface.
This commit is contained in:
Ghostkeeper 2017-10-16 11:13:55 +02:00
parent 5c0488c182
commit dea230ed6a
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -4,6 +4,7 @@
from PyQt5.QtCore import Qt, pyqtSignal, pyqtProperty, QTimer from PyQt5.QtCore import Qt, pyqtSignal, pyqtProperty, QTimer
from typing import Iterable from typing import Iterable
from UM.i18n import i18nCatalog
import UM.Qt.ListModel import UM.Qt.ListModel
from UM.Application import Application from UM.Application import Application
import UM.FlameProfiler import UM.FlameProfiler
@ -11,6 +12,8 @@ from cura.Settings.ExtruderManager import ExtruderManager
from cura.Settings.ExtruderStack import ExtruderStack #To listen to changes on the extruders. from cura.Settings.ExtruderStack import ExtruderStack #To listen to changes on the extruders.
from cura.Settings.MachineManager import MachineManager #To listen to changes on the extruders of the currently active machine. from cura.Settings.MachineManager import MachineManager #To listen to changes on the extruders of the currently active machine.
catalog = i18nCatalog("cura")
## Model that holds extruders. ## Model that holds extruders.
# #
# This model is designed for use by any list of extruders, but specifically # This model is designed for use by any list of extruders, but specifically
@ -172,7 +175,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
color = material.getMetaDataEntry("color_code", default = self.defaultColors[0]) if material else self.defaultColors[0] color = material.getMetaDataEntry("color_code", default = self.defaultColors[0]) if material else self.defaultColors[0]
item = { item = {
"id": global_container_stack.getId(), "id": global_container_stack.getId(),
"name": "Global", "name": catalog.i18nc("@menuitem", "Global"),
"color": color, "color": color,
"index": -1, "index": -1,
"definition": "" "definition": ""
@ -215,7 +218,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
if self._add_optional_extruder: if self._add_optional_extruder:
item = { item = {
"id": "", "id": "",
"name": "Not overridden", "name": catalog.i18nc("@menuitem", "Not overridden"),
"color": "#ffffff", "color": "#ffffff",
"index": -1, "index": -1,
"definition": "" "definition": ""