setup-index.jsp 4.21 KB
Newer Older
1 2
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
Matt Tucker's avatar
Matt Tucker committed
3 4 5 6 7 8 9
<%--
  -	$RCSfile$
  -	$Revision$
  -	$Date$
--%>

<%@ page import="org.jivesoftware.util.ParamUtils,
10
                 org.jivesoftware.util.JiveGlobals,
11
                 java.util.*" %>
Matt Tucker's avatar
Matt Tucker committed
12 13 14 15 16 17 18 19 20 21

<%! // Global vars, methods, etc

    static final String JIVE_HOME = "jive_home";
    static final String JIVE_LICENSE = "jive_license_file";
    static final String JIVE_LICENSE_TEXT = "jive_license_text";
    static final String JIVE_DEPENDENCY = "jive_dependency";
    static final String JIVE_CONFIG_FILE = "jive_config_file";
%>

Bill Lynch's avatar
Bill Lynch committed
22
<%@ include file="setup-global.jspf" %>
Matt Tucker's avatar
Matt Tucker committed
23

24
<%@ include file="setup-env-check.jspf" %>
Matt Tucker's avatar
Matt Tucker committed
25 26

<%  // Get parameters
27 28
    String localeCode = ParamUtils.getParameter(request,"localeCode");
    boolean save = request.getParameter("save") != null;
Matt Tucker's avatar
Matt Tucker committed
29 30 31

    Map errors = new HashMap();

32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
    if (save) {
        Locale newLocale = null;
        if (localeCode != null) {
            newLocale = LocaleUtils.localeCodeToLocale(localeCode.trim());
            if (newLocale == null) {
                errors.put("localeCode","");
            }
            else {
                JiveGlobals.setLocale(newLocale);
                // update the sidebar status
                session.setAttribute("jive.setup.sidebar.1","done");
                session.setAttribute("jive.setup.sidebar.2","in_progress");
                // redirect
                response.sendRedirect("setup-host-settings.jsp");
                return;
            }
        }
    }

    Locale locale = JiveGlobals.getLocale();
Matt Tucker's avatar
Matt Tucker committed
52 53
%>

54
<%@ include file="setup-header.jspf" %>
Matt Tucker's avatar
Matt Tucker committed
55 56

<p class="jive-setup-page-header">
57
<fmt:message key="setup.index.title" />
Matt Tucker's avatar
Matt Tucker committed
58 59 60 61 62
</p>

<p>


63 64 65
<fmt:message key="setup.index.info">
    <fmt:param value="<%= LocaleUtils.getLocalizedString("title") %>" />
</fmt:message>
Matt Tucker's avatar
Matt Tucker committed
66 67
</p>

68
<form action="setup-index.jsp" name="sform">
Matt Tucker's avatar
Matt Tucker committed
69

70
<b>Choose Language</b>
Matt Tucker's avatar
Matt Tucker committed
71

72 73 74 75 76 77 78
<%  boolean usingPreset = false;
    Locale[] locales = Locale.getAvailableLocales();
    for (int i=0; i<locales.length; i++) {
        usingPreset = locales[i].equals(locale);
        if (usingPreset) { break; }
    }
%>
Matt Tucker's avatar
Matt Tucker committed
79

80 81 82 83 84
<ul>
<table cellpadding="4" cellspacing="0" border="0">
<tbody>
    <tr>
        <td>
85
            <input type="radio" name="localeCode" value="cs_CZ" <%= ("cs_CZ".equals(locale.toString()) ? "checked" : "") %>
86 87 88
             id="loc01" />
        </td>
        <td colspan="2">
89
            <label for="loc01">Czech</label> (cs_CZ)
90 91 92 93
        </td>
    </tr>
    <tr>
        <td>
94
            <input type="radio" name="localeCode" value="de" <%= ("de".equals(locale.toString()) ? "checked" : "") %>
95 96
             id="loc02" />
        </td>
97 98
        <td colspan="2">
            <label for="loc02">Deutsch</label> (de)
99 100
        </td>
    </tr>
101 102
    <tr>
        <td>
103
            <input type="radio" name="localeCode" value="en" <%= ("en".equals(locale.toString()) ? "checked" : "") %>
104 105 106
             id="loc03" />
        </td>
        <td colspan="2">
107
            <label for="loc03">English</label> (en)
108 109 110 111
        </td>
    </tr>
    <tr>
        <td>
112
            <input type="radio" name="localeCode" value="fr" <%= ("fr".equals(locale.toString()) ? "checked" : "") %>
113 114 115
             id="loc04" />
        </td>
        <td colspan="2">
116
            <label for="loc04">Fran&ccedil;ais</label> (fr)
117 118 119 120 121 122 123 124
        </td>
    </tr>
    <tr>
        <td>
            <input type="radio" name="localeCode" value="nl" <%= ("nl".equals(locale.toString()) ? "checked" : "") %>
             id="loc05" />
        </td>
        <td colspan="2">
125 126 127 128 129 130 131 132 133 134 135 136 137
            <label for="loc05">Nederlands</label> (nl)
        </td>
    </tr>
    <tr>
        <td>
            <input type="radio" name="localeCode" value="zh_CN" <%= ("zh_CN".equals(locale.toString()) ? "checked" : "") %>
             id="loc06" />
        </td>
        <td>
            <a href="#" onclick="document.sform.localeCode[1].checked=true; return false;"><img src="images/language_zh_CN.gif" border="0" /></a>
        </td>
        <td>
            <label for="loc06">Simplified Chinese</label> (zh_CN)
138 139
        </td>
    </tr>
140 141 142 143 144 145 146 147 148
</tbody>
</table>
</ul>

<br/>
<hr size="0">

<div align="right">
<input type="submit" name="save" value=" Continue ">
Matt Tucker's avatar
Matt Tucker committed
149 150 151 152
</div>
</form>

<%@ include file="setup-footer.jsp" %>