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
configuration_language_list = []\n
for item in context.WizardTool_getConfigurationLanguageList():\n
configuration_language_list.append(item[1])\n
accept_language = REQUEST.get(\'HTTP_ACCEPT_LANGUAGE\', \'en\')\n
accept_language_tag = accept_language.split(\';\')[0].split(\',\')[0]\n
primary_language = accept_language_tag.split(\'-\')[0]\n
if primary_language in configuration_language_list:\n
return primary_language\n
http_accept_language = REQUEST.get(\'HTTP_ACCEPT_LANGUAGE\', \'en\')\n
\n
for language_set in http_accept_language.split(\',\'):\n
language_tag = language_set.split(\';\')[0]\n
language = language_tag.split(\'-\')[0]\n
if language in configuration_language_list:\n
return language\n
return \'en\'\n
</string> </value>
</item>
......@@ -118,9 +120,10 @@ return \'en\'\n
<string>_getiter_</string>
<string>item</string>
<string>_getitem_</string>
<string>accept_language</string>
<string>accept_language_tag</string>
<string>primary_language</string>
<string>http_accept_language</string>
<string>language_set</string>
<string>language_tag</string>
<string>language</string>
</tuple>
</value>
</item>
......
2008-10-9 yusei
* Handle HTTP_ACCEPT_LANGUAGE better.
2008-10-06 ivan
* User server side rendered messages (for i18n)
......
127
\ No newline at end of file
128
\ 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