Author: sshyrkov
Date: Tue Jul 17 11:06:31 2007
New Revision: 18018

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18018&repname=
=3Djahia
Log:
JAHIA-1595: Choix de la langue: manque d'homogeneit=C3=A9 dans les proposit=
ions =

http://www.jahia.net/jira/browse/JAHIA-1595
Resolved:
1) Synchronize selected language with the page localization language
2) Add reload on language selection change

Modified:
    branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/bin/JahiaConfigura=
tionWizard.java
    branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/configuration_wi=
zard/welcome.jsp

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/bin/JahiaCon=
figurationWizard.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/java/org/jahia/bin/JahiaConfigurationWizard.java&rev=3D180=
18&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/bin/JahiaConfigura=
tionWizard.java (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/java/org/jahia/bin/JahiaConfigura=
tionWizard.java Tue Jul 17 11:06:31 2007
@@ -414,7 +414,10 @@
         // now let's set the selected locale according to what we know abo=
ut
         // locales so far...
         Locale selectedLocale =3D null;
-        String selectedLanguageCode =3D (String) values.get("welcome_newLo=
cale");
+        String selectedLanguageCode =3D request.getParameter("newLocale");
+        if (selectedLanguageCode =3D=3D null) {
+                       selectedLanguageCode =3D (String) 
values.get("welcome_newLocale");
+               }
         if (selectedLanguageCode !=3D null) {
             selectedLocale =3D LanguageCodeConverters.languageCodeToLocale=
(selectedLanguageCode);
         }
@@ -425,9 +428,18 @@
                 selectedLocale =3D defaultLocale;
             }
         }
-        if (availableBundleLocales.contains(selectedLocale)) {
-            values.put("welcome_newLocale", selectedLocale.toString());
+        =

+        if (!availableBundleLocales.contains(selectedLocale) && selectedLo=
cale.getCountry() !=3D null) {
+               Locale langOnlyLocale =3D new 
Locale(selectedLocale.getLanguage()=
);
+               if (availableBundleLocales.contains(langOnlyLocale)) {
+                       selectedLocale =3D langOnlyLocale;
+               }
         }
+        if (!availableBundleLocales.contains(selectedLocale)) {
+               selectedLocale =3D defaultLocale;
+        }
+        values.put("welcome_newLocale", selectedLocale.toString());
+        request.getSession().setAttribute(ProcessingContext.SESSION_LOCALE=
, selectedLocale);
 =

         // forward to the jsp...
         request.setAttribute("method", "welcome_process");
@@ -1380,61 +1392,6 @@
     // end checkServerSlashs()
 =

     /**
-     * Try to establish a connection with the host url indicates by the us=
er
-     * on the server settings page, and check some error(s) (like HTTP-403=
, etc).
-     *
-     * @throws Exception an exception occured during the process.
-     */
-    private void tryHostURL()
-            throws Exception {
-        URL url =3D null;
-        InputStream istream;
-
-        try {
-            url =3D new URL(((String) values.get("server_url")));
-            istream =3D url.openStream();
-            istream.close();
-
-        } catch (Exception e) {
-            logger.error("Error while testing connection to server URL " +=
 url, e);
-        }
-    }
-    // end tryHostURL()
-
-
-    /**
-     * Try to establish a connection with the host url indicates by the us=
er
-     * on the server settings page, and check some error(s) (like HTTP-403=
, etc).
-     *
-     * @throws Exception an exception occured during the process.
-     */
-    private void tryWebAppsDeployBaseURL()
-            throws Exception {
-        URL url =3D null;
-        InputStream istream;
-
-        try {
-            url =3D new URL((values.get("webapps_deploybaseurl")) + "/list=
");
-            istream =3D url.openStream();
-            istream.close();
-
-        } catch (Exception e) {
-            String errorMessage =3D e.getMessage();
-            if ((errorMessage !=3D null) && (errorMessage.indexOf("401") !=
=3D -1)) {
-                // this is an expected condition, since we do not yet have
-                // access to the manager app, and the configuration wizard
-                // will set it up.
-            } else {
-                logger.error(
-                        "Error while connecting to web apps deployment URL=
 at : " +
-                                url, e);
-            }
-        }
-    }
-    // end tryHostURL()
-
-
-    /**
      * Try to create the path to jahia files indicates by the user on the
      * server settings page, and check some error(s) (like permissions, et=
c).
      *
@@ -1727,25 +1684,6 @@
 =

 =

     /**
-     * Create the folder where jahia must store the xml templates files.
-     * If this folder already exists and have some content, remove it.
-     */
-    private void folderXMLtemplates()
-            throws Exception {
-        final File folder =3D new File(Jahia.jahiaTemplatesScriptsPath);
-        if (!folder.exists()) {
-            folder.mkdirs();
-        } else {
-            final File[] list =3D folder.listFiles();
-            for (int i =3D 0; i < list.length; i++) {
-                JahiaTools.deleteFile(list[i]);
-            }
-        }
-    }
-    // end folderXMLtemplates()
-
-
-    /**
      * Set the properties object, using data containing in the *values* ha=
shmap,
      * using the jahia's propertiesmanager object.
      */

Modified: branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/configurat=
ion_wizard/welcome.jsp
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/branches/JAHIA-5-0-SP=
-BRANCH/core/src/webapp/jsp/jahia/configuration_wizard/welcome.jsp&rev=3D18=
018&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/configuration_wi=
zard/welcome.jsp (original)
+++ branches/JAHIA-5-0-SP-BRANCH/core/src/webapp/jsp/jahia/configuration_wi=
zard/welcome.jsp Tue Jul 17 11:06:31 2007
@@ -15,7 +15,7 @@
 See the License for the specific language governing permissions and =

 limitations under the License.
 --%><%@ page language=3D"java" contentType=3D"text/html;charset=3DUTF-8" %=
><%@ include file=3D"header.inc" %>
-<%@ page import=3D"java.util.*, org.apache.commons.lang.StringUtils, org.j=
ahia.params.ProcessingContext" %>
+<%@ page import=3D"org.apache.commons.lang.StringUtils, org.jahia.params.P=
rocessingContext" %>
 <%@ taglib uri=3D"JahiaLib" prefix=3D"jahia" %>
 =

 <jsp:useBean id=3D"javavendor" class=3D"java.lang.String" scope=3D"request=
"/>
@@ -82,7 +82,7 @@
     <h4>
         <jahia:message key=3D"org.jahia.bin.JahiaConfigurationWizard.welco=
me.selectInstallationLanguage.label"/>
     </h4>
-    <select name=3D"newLocale">
+    <select name=3D"newLocale" onchange=3D"submitFormular('welcome', 'back=
')">
         <%
             final Enumeration localeEnum =3D availableBundleLocales.elemen=
ts();
         Locale usedLocale =3D session.getAttribute(ProcessingContext.SESSI=
ON_LOCALE) !=3D null ?

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to