Commit 83053197 authored by Yusei Tahara's avatar Yusei Tahara

2008-10-9 yusei

* Handle HTTP_ACCEPT_LANGUAGE better.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24122 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bf7a9d7d
...@@ -66,11 +66,13 @@ if user_preferred_language is not None:\n ...@@ -66,11 +66,13 @@ if user_preferred_language is not None:\n
configuration_language_list = []\n configuration_language_list = []\n
for item in context.WizardTool_getConfigurationLanguageList():\n for item in context.WizardTool_getConfigurationLanguageList():\n
configuration_language_list.append(item[1])\n configuration_language_list.append(item[1])\n
accept_language = REQUEST.get(\'HTTP_ACCEPT_LANGUAGE\', \'en\')\n http_accept_language = REQUEST.get(\'HTTP_ACCEPT_LANGUAGE\', \'en\')\n
accept_language_tag = accept_language.split(\';\')[0].split(\',\')[0]\n \n
primary_language = accept_language_tag.split(\'-\')[0]\n for language_set in http_accept_language.split(\',\'):\n
if primary_language in configuration_language_list:\n language_tag = language_set.split(\';\')[0]\n
return primary_language\n language = language_tag.split(\'-\')[0]\n
if language in configuration_language_list:\n
return language\n
return \'en\'\n return \'en\'\n
</string> </value> </string> </value>
</item> </item>
...@@ -118,9 +120,10 @@ return \'en\'\n ...@@ -118,9 +120,10 @@ return \'en\'\n
<string>_getiter_</string> <string>_getiter_</string>
<string>item</string> <string>item</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>accept_language</string> <string>http_accept_language</string>
<string>accept_language_tag</string> <string>language_set</string>
<string>primary_language</string> <string>language_tag</string>
<string>language</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
2008-10-9 yusei
* Handle HTTP_ACCEPT_LANGUAGE better.
2008-10-06 ivan 2008-10-06 ivan
* User server side rendered messages (for i18n) * User server side rendered messages (for i18n)
......
127 128
\ No newline at end of file \ No newline at end of file
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