index.jsp 5.13 KB
Newer Older
1 2 3 4 5 6 7 8 9
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>

<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<%--
  -	$RCSfile$
  -	$Revision: 2873 $
  -	$Date: 2005-09-23 10:54:57 -0700 (Fri, 23 Sep 2005) $
--%>

10 11
<%@ page import="org.jivesoftware.util.JiveGlobals,
                 org.jivesoftware.util.ParamUtils,
12
                 org.jivesoftware.openfire.XMPPServer" %>
13 14 15
<%@ page import="java.util.HashMap"%>
<%@ page import="java.util.Locale"%>
<%@ page import="java.util.Map"%>
16 17

<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
18 19 20 21 22 23 24 25 26 27

<%! // 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";
%>

28 29 30 31 32 33 34
<%
	// Redirect if we've already run setup:
	if (!XMPPServer.getInstance().isSetupMode()) {
        response.sendRedirect("setup-completed.jsp");
        return;
    }
%>
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62

<%@ include file="setup-env-check.jspf" %>

<%  // Get parameters
    String localeCode = ParamUtils.getParameter(request,"localeCode");
    boolean save = request.getParameter("save") != null;

    Map errors = new HashMap();

    if (save) {
        Locale newLocale = null;
        if (localeCode != null) {
            newLocale = LocaleUtils.localeCodeToLocale(localeCode.trim());
            if (newLocale == null) {
                errors.put("localeCode","");
            }
            else {
                JiveGlobals.setLocale(newLocale);
                // redirect
                response.sendRedirect("setup-host-settings.jsp");
                return;
            }
        }
    }

    Locale locale = JiveGlobals.getLocale();
%>

63
<html>
64 65
<head>
<title><fmt:message key="setup.index.title" /></title>
66
<meta name="currentStep" content="0"/>
67 68
</head>
<body>
69

70

71 72 73
	<h1>
	<fmt:message key="setup.index.title" />
	</h1>
74

75 76 77 78 79
	<p>
	<fmt:message key="setup.index.info">
		<fmt:param value="<%= LocaleUtils.getLocalizedString("title") %>" />
	</fmt:message>
	</p>
80 81


82 83
	<!-- BEGIN jive-contentBox -->
	<div class="jive-contentBox">
84

85
	<h2><fmt:message key="setup.index.choose_lang" /></h2>
86

87
	<form action="index.jsp" name="sform">
88 89 90 91 92 93 94
<%  boolean usingPreset = false;
    Locale[] locales = Locale.getAvailableLocales();
    for (int i=0; i<locales.length; i++) {
        usingPreset = locales[i].equals(locale);
        if (usingPreset) { break; }
    }
%>
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
		<div id="jive-setup-language">
			<p>
			<label for="loc01">
			<input type="radio" name="localeCode" value="cs_CZ" <%= ("cs_CZ".equals(locale.toString()) ? "checked" : "") %> id="loc01" />
			<b>Czech</b> (cs_CZ)
			</label><br>

			<label for="loc02">
			<input type="radio" name="localeCode" value="de" <%= ("de".equals(locale.toString()) ? "checked" : "") %> id="loc02" />
			<b>Deutsch</b> (de)
			</label><br>

			<label for="loc03">
			<input type="radio" name="localeCode" value="en" <%= ("en".equals(locale.toString()) ? "checked" : "") %> id="loc03" />
			<b>English</b> (en)
			</label><br>

			<label for="loc04">
			<input type="radio" name="localeCode" value="es" <%= ("es".equals(locale.toString()) ? "checked" : "") %> id="loc04" />
			<b>Espa&ntilde;ol</b> (es)
			</label><br>

			<label for="loc05">
			<input type="radio" name="localeCode" value="fr" <%= ("fr".equals(locale.toString()) ? "checked" : "") %> id="loc05" />
			<b>Fran&ccedil;ais</b> (fr)
			</label><br>

			<label for="loc06">
			<input type="radio" name="localeCode" value="nl" <%= ("nl".equals(locale.toString()) ? "checked" : "") %> id="loc06" />
			<b>Nederlands</b> (nl)
			</label><br>

			<label for="loc07">
			<input type="radio" name="localeCode" value="pl_PL" <%= ("pl_PL".equals(locale.toString()) ? "checked" : "") %> id="loc07" />
			<b>Polski</b> (pl_PL)
			</label><br>

			<label for="loc08">
			<input type="radio" name="localeCode" value="pt_BR" <%= ("pt_BR".equals(locale.toString()) ? "checked" : "") %> id="loc08" />
			<b>Portugu&ecirc;s Brasileiro</b> (pt_BR)
			</label><br>

			<label for="loc09">
138 139
			<input type="radio" name="localeCode" value="ru_RU" <%= ("ru_RU".equals(locale.toString()) ? "checked" : "") %>  id="loc09" />
            <b>&#x420;&#x443;&#x441;&#x441;&#x43A;&#x438;&#x439;</b> (ru_RU)
140 141 142
			</label><br>

			<label for="loc10">
143 144 145 146 147 148
			<input type="radio" name="localeCode" value="sk" <%= ("sk".equals(locale.toString()) ? "checked" : "") %> id="loc10" />
			<b>Sloven&#269;ina</b> (sk)
			</label><br>

			<label for="loc11">
			<input type="radio" name="localeCode" value="zh_CN" <%= ("zh_CN".equals(locale.toString()) ? "checked" : "") %> id="loc11" />
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
            <img src="../images/setup_language_zh_CN.gif" border="0" align="top" />
            <b>Simplified Chinese</b> (zh_CN)
			</label><br>
			</p>
		</div>

		<div align="right">
			<input type="Submit" name="save" value="<fmt:message key="global.continue" />" id="jive-setup-save" border="0">
		</div>
	</form>

	</div>
	<!-- END jive-contentBox -->


</body>
</html>