Only use the new language when the OK button was pressed
Merge pull request #4753 from TomMalbran/tom/issue-4750

Fix #4750: It still will switch language if you click the cancel button.