src/main/webapp/WEB-INF/dynamic_fragments/language.jsp

changeset 39
e722861558bb
parent 29
27a0fdd7bca7
child 72
0646c14e36fb
equal deleted inserted replaced
38:cf85ef18f231 39:e722861558bb
22 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 22 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 23 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 24 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 --%> 26 --%>
27 <%@page pageEncoding="UTF-8" session="true" %> 27 <%@page pageEncoding="UTF-8" %>
28 <%@page import="de.uapcore.lightpit.Constants" %> 28 <%@page import="de.uapcore.lightpit.Constants" %>
29 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 29 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
30 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 30 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
31 31
32 <c:set scope="page" var="currentLanguage" value="${sessionScope[Constants.SESSION_ATTR_LANGUAGE]}" /> 32 <jsp:useBean id="languages" type="java.util.List<java.util.Locale>" scope="request"/>
33 <jsp:useBean id="browserLanguage" type="java.util.Locale" scope="request"/>
33 34
34 <form method="POST"id="lang-selector"> 35 <c:set scope="page" var="currentLanguage" value="${sessionScope[Constants.SESSION_ATTR_LANGUAGE]}"/>
36
37 <form method="POST" id="lang-selector">
35 <c:forEach items="${languages}" var="l"> 38 <c:forEach items="${languages}" var="l">
36 <label> 39 <label>
37 <input type="radio" name="language" value="${l.language}" 40 <input type="radio" name="language" value="${l.language}"
38 <c:if test="${l.language eq currentLanguage.language}">checked</c:if>/> 41 <c:if test="${l.language eq currentLanguage.language}">checked</c:if>/>
39 ${l.displayLanguage} 42 ${l.displayLanguage}
40 (${l.getDisplayLanguage(currentLanguage)}<c:if test="${not empty browserLanguage and l.language eq browserLanguage.language}"><c:set var="browserLanguagePresent" value="true"/>&nbsp;-&nbsp;<fmt:message key="browserLanguage"/></c:if>) 43 (${l.getDisplayLanguage(currentLanguage)}
44 <c:if test="${not empty browserLanguage and l.language eq browserLanguage.language}"><c:set
45 var="browserLanguagePresent" value="true"/>&nbsp;-&nbsp;<fmt:message key="browserLanguage"/></c:if>)
41 </label> 46 </label>
42 </c:forEach> 47 </c:forEach>
43 <c:if test="${not browserLanguagePresent}"> 48 <c:if test="${not browserLanguagePresent}">
44 <span class="blNA"><fmt:message key="browserLanguageNotAvailable" /></span> 49 <span class="blNA"><fmt:message key="browserLanguageNotAvailable" /></span>
45 </c:if> 50 </c:if>

mercurial