Moved the update of flask.session['locale'] to util.py