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

changeset 86
0a658e53177c
parent 74
91d1fc2a3a14
child 180
009700915269
equal deleted inserted replaced
85:3d16ad54b3dc 86:0a658e53177c
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" %> 27 <%@page pageEncoding="UTF-8" %>
28 <%@page import="de.uapcore.lightpit.Constants" %>
29 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 28 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
30 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> 29 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
31 30
32 <jsp:useBean id="languages" type="java.util.List<java.util.Locale>" scope="request"/> 31 <jsp:useBean id="viewmodel" type="de.uapcore.lightpit.viewmodel.LanguageView" scope="request"/>
33 <jsp:useBean id="browserLanguage" type="java.util.Locale" scope="request"/>
34
35 <c:set scope="page" var="currentLanguage" value="${sessionScope[Constants.SESSION_ATTR_LANGUAGE]}"/>
36 32
37 <form method="POST" id="lang-selector"> 33 <form method="POST" id="lang-selector">
38 <c:forEach items="${languages}" var="l"> 34 <c:forEach items="${viewmodel.languages}" var="l">
39 <label> 35 <label>
40 <input type="radio" name="language" value="${l.language}" 36 <input type="radio" name="language" value="${l.language}"
41 <c:if test="${l.language eq currentLanguage.language}">checked</c:if>/> 37 <c:if test="${l.language eq viewmodel.currentLanguage.language}">checked</c:if>/>
42 ${l.displayLanguage} 38 ${l.displayLanguage}
43 (${l.getDisplayLanguage(currentLanguage)} 39 (${l.getDisplayLanguage(viewmodel.currentLanguage)}
44 <c:if test="${not empty browserLanguage and l.language eq browserLanguage.language}"><c:set 40 <c:if test="${not empty viewmodel.browserLanguage and l.language eq viewmodel.browserLanguage.language}"><c:set
45 var="browserLanguagePresent" value="true"/>&nbsp;-&nbsp;<fmt:message key="browserLanguage"/></c:if>) 41 var="browserLanguagePresent" value="true"/>&nbsp;-&nbsp;<fmt:message key="browserLanguage"/></c:if>)
46 </label> 42 </label>
47 </c:forEach> 43 </c:forEach>
48 <c:if test="${not browserLanguagePresent}"> 44 <c:if test="${not browserLanguagePresent}">
49 <span class="blNA"><fmt:message key="browserLanguageNotAvailable"/></span> 45 <span class="blNA"><fmt:message key="browserLanguageNotAvailable"/></span>

mercurial