Commit 6b09476e authored by Yusei Tahara's avatar Yusei Tahara

Store user preferred language in cookie.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23983 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 12b9420d
......@@ -424,7 +424,11 @@ class WizardTool(BaseTool):
## add local ERP5 instance url
parameter_dict['erp5_url'] = self.getPortalObject().absolute_url()
# add user preffered language
parameter_dict['user_preferred_language'] = getattr(self, 'user_preferred_language', 'en')
REQUEST = getattr(self, 'REQUEST', None)
if REQUEST is None:
parameter_dict['user_preferred_language'] = 'en'
else:
parameter_dict['user_preferred_language'] = REQUEST.cookies.get('configurator_user_preferred_language', 'en')
def _updateParameterDictWithFileUpload(self, parameter_dict):
"""Updates parameter_dict to replace file upload with their file content,
......@@ -577,7 +581,9 @@ class WizardTool(BaseTool):
# set user preferred configuration language
user_preferred_language = REQUEST.get('field_my_user_preferred_language', None)
if user_preferred_language:
self.user_preferred_language = user_preferred_language
REQUEST.RESPONSE.setCookie('configurator_user_preferred_language',
user_preferred_language,
expires=(DateTime()+30).rfc822())
# set encoded __ac_express cookie at client's browser
__ac_express = quote(encodestring(password))
expires = (DateTime() + 1).toZone('GMT').rfc822()
......
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