[Erp5-report] r23818 - in /erp5/trunk/bt5/erp5_wizard: SkinTemplateItem/portal_skins/erp5_w...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Sep 25 14:42:32 CEST 2008


Author: ivan
Date: Thu Sep 25 14:42:27 2008
New Revision: 23818

URL: http://svn.erp5.org?rev=23818&view=rev
Log:
Wizard uses client's preferred language settings.

Added:
    erp5/trunk/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_getConfigurationLanguageList.xml
    erp5/trunk/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_getUserPreferredLanguage.xml
Modified:
    erp5/trunk/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_view/my_user_preferred_language.xml
    erp5/trunk/bt5/erp5_wizard/bt/change_log
    erp5/trunk/bt5/erp5_wizard/bt/revision

Added: erp5/trunk/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_getConfigurationLanguageList.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_getConfigurationLanguageList.xml?rev=23818&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_getConfigurationLanguageList.xml (added)
+++ erp5/trunk/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_getConfigurationLanguageList.xml Thu Sep 25 14:42:27 2008
@@ -1,0 +1,125 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string># XXX: take this list from remote server using portal_wizard calls\n
+return ((\'English\', \'en\'), \n
+        (\'French\', \'fr\'))\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple/>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>WizardTool_getConfigurationLanguageList</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Get available configuration languages</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: erp5/trunk/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_getUserPreferredLanguage.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_getUserPreferredLanguage.xml?rev=23818&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_getUserPreferredLanguage.xml (added)
+++ erp5/trunk/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_getUserPreferredLanguage.xml Thu Sep 25 14:42:27 2008
@@ -1,0 +1,147 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>configuration_language_list = []\n
+user_preferred_language = getattr(context, \'user_preferred_language\', None)\n
+if user_preferred_language is not None:\n
+  # user already have explicitly selected language\n
+  return user_preferred_language \n
+\n
+# use language from browser\'s settings\n
+for item in context.WizardTool_getConfigurationLanguageList():\n
+  configuration_language_list.append(item[1])\n
+accept_language = context.REQUEST.get(\'HTTP_ACCEPT_LANGUAGE\', \'en\')\n
+accept_language = accept_language.split(\';\')[0].split(\',\')[0]\n
+if accept_language in configuration_language_list:\n
+  return accept_language\n
+return \'en\'\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>0</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>configuration_language_list</string>
+                            <string>getattr</string>
+                            <string>context</string>
+                            <string>None</string>
+                            <string>user_preferred_language</string>
+                            <string>_getiter_</string>
+                            <string>_getattr_</string>
+                            <string>item</string>
+                            <string>_getitem_</string>
+                            <string>accept_language</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>WizardTool_getUserPreferredLanguage</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Get user preferred language from browser</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: erp5/trunk/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_view/my_user_preferred_language.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_view/my_user_preferred_language.xml?rev=23818&r1=23817&r2=23818&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_view/my_user_preferred_language.xml (original)
+++ erp5/trunk/bt5/erp5_wizard/SkinTemplateItem/portal_skins/erp5_wizard/WizardTool_view/my_user_preferred_language.xml Thu Sep 25 14:42:27 2008
@@ -121,7 +121,9 @@
                 </item>
                 <item>
                     <key> <string>default</string> </key>
-                    <value> <string></string> </value>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+                    </value>
                 </item>
                 <item>
                     <key> <string>description</string> </key>
@@ -157,7 +159,9 @@
                 </item>
                 <item>
                     <key> <string>items</string> </key>
-                    <value> <string></string> </value>
+                    <value>
+                      <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
+                    </value>
                 </item>
                 <item>
                     <key> <string>required</string> </key>
@@ -233,16 +237,7 @@
                 <item>
                     <key> <string>items</string> </key>
                     <value>
-                      <list>
-                        <tuple>
-                          <string>English</string>
-                          <string>en</string>
-                        </tuple>
-                        <tuple>
-                          <string>French</string>
-                          <string>fr</string>
-                        </tuple>
-                      </list>
+                      <list/>
                     </value>
                 </item>
                 <item>
@@ -271,4 +266,36 @@
       </dictionary>
     </pickle>
   </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string>here/WizardTool_getUserPreferredLanguage</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="3" aka="AAAAAAAAAAM=">
+    <pickle>
+      <tuple>
+        <global name="TALESMethod" module="Products.Formulator.TALESField"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_text</string> </key>
+            <value> <string>here/WizardTool_getConfigurationLanguageList</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
 </ZopeData>

Modified: erp5/trunk/bt5/erp5_wizard/bt/change_log
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_wizard/bt/change_log?rev=23818&r1=23817&r2=23818&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_wizard/bt/change_log (original)
+++ erp5/trunk/bt5/erp5_wizard/bt/change_log Thu Sep 25 14:42:27 2008
@@ -1,3 +1,6 @@
+2008-09-25 ivan
+* Wizard uses client's preferred language settings
+
 2008-09-02 ivan
 * Wizard uses a dedicated template
 

Modified: erp5/trunk/bt5/erp5_wizard/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_wizard/bt/revision?rev=23818&r1=23817&r2=23818&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_wizard/bt/revision (original)
+++ erp5/trunk/bt5/erp5_wizard/bt/revision Thu Sep 25 14:42:27 2008
@@ -1,1 +1,1 @@
-92
+95




More information about the Erp5-report mailing list