i18n.jsp 939 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
<%@page contentType="text/javascript" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>

var messages = new Array();
<c:forEach var="key" items="${keys}">
    messages["<spring:message text='${key}' javaScriptEscape='true'/>"] = "<spring:message code='${key}' javaScriptEscape='true' />";
</c:forEach>

<c:forEach var="country" items="${countries}">
    messages["geo.iso3166-3.<spring:message text='${country.getCode3()}' javaScriptEscape='true'/>"] = "<c:out value='${country.getName(locale)}'/>";
12
13
</c:forEach>

14
15
16
17
<c:forEach var="geoRegion" items="${geoRegions}">
    messages["<spring:message text='${geoRegion.getName()}' javaScriptEscape='true'/>"] = "<c:out value='${geoRegion.getName(locale)}'/>";
</c:forEach>

18
19
<c:forEach items="${cropsNames}" var="cropName">
    messages["${cropName.key}"] = "${cropName.value}";
20
</c:forEach>