Skip to content
Snippets Groups Projects
Commit 7584e407 authored by ale's avatar ale
Browse files

Set a default language when autodetection fails

parent 6db5d180
No related branches found
No related tags found
No related merge requests found
......@@ -60,6 +60,8 @@ def init_app(app, talisman):
else:
g.lang = request.accept_languages.best_match(
app.config['SUPPORTED_LANGUAGES_ISO'])
if not g.lang:
g.lang = 'en'
@app.after_request
def _set_custom_headers(response):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment