mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-21 13:47:51 -06:00
Use intent category if no translation is available
Previously we would only accept intents that had a translation. If we could not find one, we would use "unknown" as the intent category. However, we didn't really do this consistently. In some places it would show unkown and in others we'd show the intent type. This should make the behavior the same across the board. It will try to get a translation for the intent category and show that. If it's unable to find that it will use the category instead. Note that it will use the python title function to ensure it has nice capitalisation CURA-9297
This commit is contained in:
parent
8579a6baf3
commit
e6551821aa
3 changed files with 4 additions and 3 deletions
|
@ -111,7 +111,7 @@ class IntentCategoryModel(ListModel):
|
||||||
except ValueError:
|
except ValueError:
|
||||||
weight = 99
|
weight = 99
|
||||||
result.append({
|
result.append({
|
||||||
"name": IntentCategoryModel.translation(category, "name", category),
|
"name": IntentCategoryModel.translation(category, "name", category.title()),
|
||||||
"description": IntentCategoryModel.translation(category, "description", None),
|
"description": IntentCategoryModel.translation(category, "description", None),
|
||||||
"intent_category": category,
|
"intent_category": category,
|
||||||
"weight": weight,
|
"weight": weight,
|
||||||
|
|
|
@ -358,8 +358,9 @@ class QualityManagementModel(ListModel):
|
||||||
"quality_type": quality_type,
|
"quality_type": quality_type,
|
||||||
"quality_changes_group": None,
|
"quality_changes_group": None,
|
||||||
"intent_category": intent_category,
|
"intent_category": intent_category,
|
||||||
"section_name": catalog.i18nc("@label", intent_translations.get(intent_category, {}).get("name", catalog.i18nc("@label", "Unknown"))),
|
"section_name": catalog.i18nc("@label", intent_translations.get(intent_category, {}).get("name", catalog.i18nc("@label", intent_category.title()))),
|
||||||
})
|
})
|
||||||
|
|
||||||
# Sort by quality_type for each intent category
|
# Sort by quality_type for each intent category
|
||||||
intent_translations_list = list(intent_translations)
|
intent_translations_list = list(intent_translations)
|
||||||
|
|
||||||
|
|
|
@ -1611,7 +1611,7 @@ class MachineManager(QObject):
|
||||||
if intent_category != "default":
|
if intent_category != "default":
|
||||||
intent_display_name = IntentCategoryModel.translation(intent_category,
|
intent_display_name = IntentCategoryModel.translation(intent_category,
|
||||||
"name",
|
"name",
|
||||||
catalog.i18nc("@label", "Unknown"))
|
intent_category.title())
|
||||||
display_name = "{intent_name} - {the_rest}".format(intent_name = intent_display_name,
|
display_name = "{intent_name} - {the_rest}".format(intent_name = intent_display_name,
|
||||||
the_rest = display_name)
|
the_rest = display_name)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue