From fed1f5786e848c159cba7f20503a915dce025db3 Mon Sep 17 00:00:00 2001 From: "Jannis M. Hoffmann" Date: Thu, 7 Dec 2023 22:20:59 +0100 Subject: bugfix default language --- src/jwebmail/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/jwebmail') 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): -- cgit v1.2.3