Browse Source

Get translation from list of keys rather than items

Because the category is not in a list of tuples. It's just the key of the dict.

Contributes to issue CURA-6597.
Ghostkeeper 5 years ago
parent
commit
0047874f03
1 changed files with 1 additions and 1 deletions
  1. 1 1
      cura/Machines/Models/IntentCategoryModel.py

+ 1 - 1
cura/Machines/Models/IntentCategoryModel.py

@@ -58,6 +58,6 @@ class IntentCategoryModel(ListModel):
             result.append({
                 "name": self.name_translation.get(category, catalog.i18nc("@label", "Unknown")),
                 "intent_category": category,
-                "weight": list(self.name_translation.items()).index(category)
+                "weight": list(self.name_translation.keys()).index(category)
             })
         super().update(result)