From 942f64771a3457da1ba25a10d930756e790204c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20Paccoud=20-=20France=20Universit=C3=A9=20Num?= =?UTF-8?q?=C3=A9rique?= Date: Mon, 6 Feb 2023 08:29:15 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8(config)=20add=20LANGUAGE=5FCODE=20to?= =?UTF-8?q?=20the=20frontend=20config.json=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The frontend was hardcoding its own default language. We need the frontend and backend to use the same default language. --- src/magnify/apps/core/api/__init__.py | 3 ++- tests/apps/core/test_core_api_frontend_configuration.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/magnify/apps/core/api/__init__.py b/src/magnify/apps/core/api/__init__.py index 7f855ce61..576ebf28f 100644 --- a/src/magnify/apps/core/api/__init__.py +++ b/src/magnify/apps/core/api/__init__.py @@ -48,7 +48,8 @@ def exception_handler(exc, context): def get_frontend_configuration(request): """Returns the frontend configuration dict as configured in settings.""" frontend_configuration = { - "JITSI_DOMAIN": settings.JITSI_CONFIGURATION["jitsi_domain"] + "JITSI_DOMAIN": settings.JITSI_CONFIGURATION["jitsi_domain"], + "LANGUAGE_CODE": settings.LANGUAGE_CODE, } frontend_configuration.update(settings.FRONTEND_CONFIGURATION) return Response(frontend_configuration) diff --git a/tests/apps/core/test_core_api_frontend_configuration.py b/tests/apps/core/test_core_api_frontend_configuration.py index 067c8ea64..5929a682d 100644 --- a/tests/apps/core/test_core_api_frontend_configuration.py +++ b/tests/apps/core/test_core_api_frontend_configuration.py @@ -35,5 +35,6 @@ def test_api_get_frontend_configuration(self): "KEYCLOAK_REALM": "magnify", "KEYCLOAK_CLIENT_ID": "magnify-front", "KEYCLOAK_EXPIRATION_SECONDS": 1800, + "LANGUAGE_CODE": "en", }, )