Updating languages and closing dialog