Commit 71e0214d authored by Jérome Perrin's avatar Jérome Perrin

Persist the language cookie when changing language

backport nexedi/erp5!506

https://www.erp5.com/project_section/capago-project/forum/Widget-preference-not-recorded-qIzYcKy7dK/view?list_start=2&reset=1#2013576401

> We can probably change this to make changing language this way more permanent. I'll discuss this with others in Nexedi.



/reviewed-on https://lab.nexedi.com/nexedi/erp5-capago/merge_requests/6
parents 264b69f4 20064ed3
...@@ -37,4 +37,4 @@ else: ...@@ -37,4 +37,4 @@ else:
if not select_language: if not select_language:
select_language = portal.Localizer.get_selected_language() select_language = portal.Localizer.get_selected_language()
portal.Localizer.changeLanguage(select_language) portal.Localizer.changeLanguage(select_language, expires=(DateTime() + 365).toZone('GMT').rfc822())
...@@ -169,7 +169,7 @@ class DummyLocalizer: ...@@ -169,7 +169,7 @@ class DummyLocalizer:
get_languages = get_supported_languages get_languages = get_supported_languages
def changeLanguage(self, lang): def changeLanguage(self, lang, expires=None):
self.lang = lang self.lang = lang
def translate(self, domain, msgid, lang=None, mapping=None, *args, **kw): def translate(self, domain, msgid, lang=None, mapping=None, *args, **kw):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment