Don't retranslate if the language didn't change
This commit is contained in:
parent
6a66b462ce
commit
149575e0c4
1 changed files with 7 additions and 3 deletions
|
|
@ -769,9 +769,13 @@ Flickable {
|
||||||
}
|
}
|
||||||
// ::onActivated must be used, as it only listens for when the index is changed by a human
|
// ::onActivated must be used, as it only listens for when the index is changed by a human
|
||||||
onActivated : {
|
onActivated : {
|
||||||
StreamingPreferences.language = languageListModel.get(currentIndex).val
|
// Retranslating is expensive, so only do it if the language actually changed
|
||||||
if (!StreamingPreferences.retranslate()) {
|
var new_language = languageListModel.get(currentIndex).val
|
||||||
ToolTip.show(qsTr("You must restart Moonlight for this change to take effect"), 5000)
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue