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.
This commit is contained in:
Ghostkeeper 2019-07-04 12:35:11 +02:00
parent a6e3828eaa
commit 0047874f03
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

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