Add /language/<language> route for changing the locale using a session variable
parent
f30cca1263
commit
7dafa22762
@ -1,4 +1,4 @@
|
|||||||
__all__ = [
|
__all__ = [
|
||||||
'admins', 'aliases', 'alternatives', 'base', 'domains', 'fetches',
|
'admins', 'aliases', 'alternatives', 'base', 'domains', 'fetches',
|
||||||
'managers', 'users', 'relays', 'tokens'
|
'managers', 'users', 'relays', 'tokens', 'languages'
|
||||||
]
|
]
|
||||||
|
@ -0,0 +1,9 @@
|
|||||||
|
from mailu.ui import ui, forms, access
|
||||||
|
|
||||||
|
import flask
|
||||||
|
|
||||||
|
|
||||||
|
@ui.route('/language/<language>', methods=['GET'])
|
||||||
|
def set_language(language=None):
|
||||||
|
flask.session['language'] = language
|
||||||
|
return flask.redirect(flask.url_for('.user_settings'))
|
Loading…
Reference in New Issue