Don't retranslate if the language didn't change

This commit is contained in:
Cameron Gutman
2021-01-31 15:28:00 -06:00
parent 6a66b462ce
commit 149575e0c4
+4
View File
@@ -769,12 +769,16 @@ Flickable {
}
// ::onActivated must be used, as it only listens for when the index is changed by a human
onActivated : {
// Retranslating is expensive, so only do it if the language actually changed
var new_language = languageListModel.get(currentIndex).val
if (StreamingPreferences.language !== new_language) {
StreamingPreferences.language = languageListModel.get(currentIndex).val
if (!StreamingPreferences.retranslate()) {
ToolTip.show(qsTr("You must restart Moonlight for this change to take effect"), 5000)
}
}
}
}
Label {
width: parent.width