From b28da7001d2e2b345ae5a89d4716ec9b35824c21 Mon Sep 17 00:00:00 2001 From: Daniel Markstedt Date: Tue, 16 May 2023 12:19:40 -0700 Subject: [PATCH] Always assign locale in detect_locale() (#1163) * Always assign locale in detect_locale() * Bump version of Debian used in CI builds from from buster to bullseye * Update code comment --------- Co-authored-by: nucleogenic --- docker/docker-compose.ci.yml | 2 +- python/web/src/web.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docker/docker-compose.ci.yml b/docker/docker-compose.ci.yml index 40bd95e6..2687eaa5 100644 --- a/docker/docker-compose.ci.yml +++ b/docker/docker-compose.ci.yml @@ -16,7 +16,7 @@ services: context: .. dockerfile: docker/web/Dockerfile args: - - OS_VERSION=buster + - OS_VERSION=bullseye volumes: - ./volumes/images:/home/pi/images:delegated init: true diff --git a/python/web/src/web.py b/python/web/src/web.py index 270e3dfc..b4c7d661 100644 --- a/python/web/src/web.py +++ b/python/web/src/web.py @@ -1373,12 +1373,13 @@ def healthcheck(): def detect_locale(): """ Get the detected locale to use for UI string translations. - This requires the Flask app to have started first. + Assign the language string to objects to be used for requests. """ if "language" not in session.keys(): session["language"] = get_locale() - piscsi_cmd.locale = session["language"] - file_cmd.locale = session["language"] + + piscsi_cmd.locale = session["language"] + file_cmd.locale = session["language"] @APP.before_request