Commit f5e38536 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

erp5_xhtml_style: make select_language mandatory in Base_doLanguage.

also stop casting select_language to str.
parent f4289a81
...@@ -16,15 +16,15 @@ if website is not None and website.isStaticLanguageSelection(): ...@@ -16,15 +16,15 @@ if website is not None and website.isStaticLanguageSelection():
referer_url = context.REQUEST.HTTP_REFERER referer_url = context.REQUEST.HTTP_REFERER
if referer_url: if referer_url:
if select_language == default_language: if select_language == default_language:
redirect_url = re.sub(website_url_pattern, r'%s\1' % root_website_url, referer_url) redirect_url = re.sub(website_url_pattern, root_website_url + r'\1', referer_url)
else: else:
redirect_url = re.sub(website_url_pattern, r'%s/%s\1' % (root_website_url, select_language), redirect_url = re.sub(website_url_pattern, root_website_url + '/' + select_language + r'\1',
referer_url) referer_url)
else: else:
if select_language == default_language: if select_language == default_language:
redirect_url = root_website_url redirect_url = root_website_url
else: else:
redirect_url = '%s/%s' % (root_website_url, select_language) redirect_url = root_website_url + '/' + select_language
return context.REQUEST.RESPONSE.redirect(redirect_url) return context.REQUEST.RESPONSE.redirect(redirect_url)
else: else:
# ERP5 Mode # ERP5 Mode
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>select_language=None</string> </value> <value> <string>select_language</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
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