(backend) the LanguagePicker now uses config as options

- config endpoint languages are used as available options for LanguagePicker
- updating the language from it, triggers an update on the user via API
This commit is contained in:
rvveber
2025-03-04 16:08:10 +01:00
committed by Samuel Paccoud
parent 23b0214a2a
commit 2bf47b7705
2 changed files with 11 additions and 5 deletions

View File

@@ -221,7 +221,9 @@ class Base(Configuration):
# Languages
LANGUAGE_CODE = values.Value("en-us")
LANGUAGE_COOKIE_NAME = "docs_language" # cookie & language is set from frontend
# cookie & language is set from frontend
LANGUAGE_COOKIE_NAME = "docs_language"
LANGUAGE_COOKIE_PATH = "/"
DRF_NESTED_MULTIPART_PARSER = {
# output of parser is converted to querydict
@@ -233,9 +235,9 @@ class Base(Configuration):
# fallback/default languages throughout the app.
LANGUAGES = values.SingleNestedTupleValue(
(
("en-us", _("English")),
("fr-fr", _("French")),
("de-de", _("German")),
("en-us", "English"),
("fr-fr", "Français"),
("de-de", "Deutsch"),
)
)