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 <nr@nucleogenic.com>
This commit is contained in:
Daniel Markstedt 2023-05-16 12:19:40 -07:00 committed by GitHub
parent 1c52dba979
commit b28da7001d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -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

View File

@ -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