summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJannis M. Hoffmann <jannis@fehcom.de>2023-12-07 22:20:59 +0100
committerJannis M. Hoffmann <jannis@fehcom.de>2023-12-07 22:20:59 +0100
commitfed1f5786e848c159cba7f20503a915dce025db3 (patch)
tree039c1ae3bcd03eab540ee971945e33249872e7d9 /src
parent99a51db801cea5ff4403c4a823b29121e5ebedc6 (diff)
bugfix default language
Diffstat (limited to 'src')
-rw-r--r--src/jwebmail/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jwebmail/__init__.py b/src/jwebmail/__init__.py
index 96b6ee2..7bc1093 100644
--- a/src/jwebmail/__init__.py
+++ b/src/jwebmail/__init__.py
@@ -68,7 +68,7 @@ def create_app():
validate_config(app)
- Babel(app, locale_selector=lambda: g.get("lang_code"))
+ babel = Babel(app, locale_selector=lambda: g.get("lang_code"))
app.cli.add_command(compile_css_command)
@@ -93,7 +93,7 @@ def create_app():
if "lang_code" in values:
return
if app.url_map.is_endpoint_expecting(endpoint, "lang_code"):
- values["lang_code"] = g.get("lang_code", app.config["BABEL_DEFAULT_LOCALE"])
+ values["lang_code"] = g.get("lang_code", babel.default_locale.language)
@app.url_value_preprocessor
def pull_lang_code(endpoint, values):