mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:15:50 +00:00
add more i18n support
This commit is contained in:
parent
dceb10a706
commit
e6e54de316
10 changed files with 132 additions and 61 deletions
|
@ -6,3 +6,50 @@ nonNumeric=must be all numeric
|
|||
duplicateFormSubmission=Duplicate form submission is not allowed
|
||||
typeMismatch.date=invalid date
|
||||
typeMismatch.birthDate=invalid date
|
||||
|
||||
home=Home
|
||||
findOwners=Find owners
|
||||
veterinarians=Veterinarians
|
||||
error=Error
|
||||
new=New
|
||||
|
||||
somethingHappened=Something happened...
|
||||
|
||||
owner=Owner
|
||||
addOwner=Add Owner
|
||||
updateOwner=Update Owner
|
||||
editOwner=Edit Owner
|
||||
lastName=Last name
|
||||
firstName=First name
|
||||
findOwner=Find Owner
|
||||
ownerInformation=Owner Information
|
||||
|
||||
name=Name
|
||||
address=Address
|
||||
city=City
|
||||
telephone=Telephone
|
||||
addNewPet=Add New Pet
|
||||
addPet=Add Pet
|
||||
updatePet=Update Pet
|
||||
editPet=Edit Pet
|
||||
addVisit=Add Visit
|
||||
petName=Name
|
||||
petsAndVisits=Pets and Visits
|
||||
birthDate=Birth Date
|
||||
type=Type
|
||||
visitDate=Visit Date
|
||||
description=Description
|
||||
|
||||
owners=Owners
|
||||
pets=Pets
|
||||
pet=Pet
|
||||
|
||||
visit=Visit
|
||||
addVisit=Add Visit
|
||||
previousVisits=Previous Visits
|
||||
date=Date
|
||||
|
||||
viewAsXml=View as XML
|
||||
viewAsJson=View as JSon
|
||||
|
||||
specialties=Specialties
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<html lang="en">
|
||||
<jsp:include page="fragments/staticFiles.jsp"/>
|
||||
|
@ -12,7 +13,7 @@
|
|||
<spring:url value="/resources/images/pets.png" var="petsImage"/>
|
||||
<img src="${petsImage}"/>
|
||||
|
||||
<h2>Something happened...</h2>
|
||||
<h2><fmt:message key="somethingHappened"/></h2>
|
||||
|
||||
<p>${exception.message}</p>
|
||||
|
||||
|
|
|
@ -8,14 +8,14 @@
|
|||
<div class="navbar-inner">
|
||||
<ul class="nav">
|
||||
<li style="width: 120px;"><a href="<spring:url value="/" htmlEscape="true" />"><i class="icon-home"></i>
|
||||
Home</a></li>
|
||||
<fmt:message key="home"/></a></li>
|
||||
<li style="width: 150px;"><a href="<spring:url value="/owners/find.html" htmlEscape="true" />"><i
|
||||
class="icon-search"></i> Find owners</a></li>
|
||||
class="icon-search"></i> <fmt:message key="findOwners"/></a></li>
|
||||
<li style="width: 160px;"><a href="<spring:url value="/vets.html" htmlEscape="true" />"><i
|
||||
class="icon-th-list"></i> Veterinarians</a></li>
|
||||
class="icon-th-list"></i><fmt:message key="veterinarians"/> </a></li>
|
||||
<li style="width: 110px;"><a href="<spring:url value="/oups.html" htmlEscape="true" />"
|
||||
title="trigger a RuntimeException to see how it is handled"><i
|
||||
class="icon-warning-sign"></i> Error</a></li>
|
||||
class="icon-warning-sign"></i><fmt:message key="error"/> </a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -21,22 +21,29 @@
|
|||
</c:choose>
|
||||
|
||||
<h2>
|
||||
<c:if test="${owner['new']}">New </c:if> Owner
|
||||
<c:if test="${owner['new']}"><fmt:message key="new"/> </c:if> <fmt:message key="owner"/>
|
||||
</h2>
|
||||
|
||||
<spring:message code="firstName" var="firstName" />
|
||||
<spring:message code="lastName" var="lastName" />
|
||||
<spring:message code="address" var="Address" />
|
||||
<spring:message code="city" var="City" />
|
||||
<spring:message code="telephone" var="Telephone" />
|
||||
|
||||
<form:form modelAttribute="owner" method="${method}" class="form-horizontal" id="add-owner-form">
|
||||
<petclinic:inputField label="First Name" name="firstName"/>
|
||||
<petclinic:inputField label="Last Name" name="lastName"/>
|
||||
<petclinic:inputField label="Address" name="address"/>
|
||||
<petclinic:inputField label="City" name="city"/>
|
||||
<petclinic:inputField label="Telephone" name="telephone"/>
|
||||
<petclinic:inputField label="${firstName}" name="firstName"/>
|
||||
<petclinic:inputField label="${lastName}" name="lastName"/>
|
||||
<petclinic:inputField label="${Address}" name="address"/>
|
||||
<petclinic:inputField label="${City}" name="city"/>
|
||||
<petclinic:inputField label="${Telephone}" name="telephone"/>
|
||||
|
||||
<div class="form-actions">
|
||||
<c:choose>
|
||||
<c:when test="${owner['new']}">
|
||||
<button type="submit">Add Owner</button>
|
||||
<button type="submit"><fmt:message key="addOwner"/></button>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<button type="submit">Update Owner</button>
|
||||
<button type="submit"><fmt:message key="updateOwner"/></button>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</div>
|
||||
|
|
|
@ -13,25 +13,25 @@
|
|||
<div class="container">
|
||||
<jsp:include page="../fragments/bodyHeader.jsp"/>
|
||||
|
||||
<h2>Find Owners</h2>
|
||||
<h2><fmt:message key="findOwners"/></h2>
|
||||
|
||||
<spring:url value="/owners.html" var="formUrl"/>
|
||||
<form:form modelAttribute="owner" action="${fn:escapeXml(formUrl)}" method="get" class="form-horizontal"
|
||||
id="search-owner-form">
|
||||
<fieldset>
|
||||
<div class="control-group" id="lastName">
|
||||
<label class="control-label">Last name </label>
|
||||
<label class="control-label"><fmt:message key="lastName"/> </label>
|
||||
<form:input path="lastName" size="30" maxlength="80"/>
|
||||
<span class="help-inline"><form:errors path="*"/></span>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<button type="submit">Find Owner</button>
|
||||
<button type="submit"><fmt:message key="findOwner"/></button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form:form>
|
||||
|
||||
<br/>
|
||||
<a href='<spring:url value="/owners/new" htmlEscape="true"/>'>Add Owner</a>
|
||||
<a href='<spring:url value="/owners/new" htmlEscape="true"/>'><fmt:message key="addOwner"/></a>
|
||||
|
||||
<jsp:include page="../fragments/footer.jsp"/>
|
||||
|
||||
|
|
|
@ -14,23 +14,23 @@
|
|||
<div class="container">
|
||||
<jsp:include page="../fragments/bodyHeader.jsp"/>
|
||||
|
||||
<h2>Owner Information</h2>
|
||||
<h2><fmt:message key="ownerInformation"/></h2>
|
||||
|
||||
<table class="table table-striped" style="width:600px;">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th><fmt:message key="name"/></th>
|
||||
<td><b><c:out value="${owner.firstName} ${owner.lastName}"/></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Address</th>
|
||||
<th><fmt:message key="address"/></th>
|
||||
<td><c:out value="${owner.address}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>City</th>
|
||||
<th><fmt:message key="city"/></th>
|
||||
<td><c:out value="${owner.city}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Telephone</th>
|
||||
<th><fmt:message key="telephone"/></th>
|
||||
<td><c:out value="${owner.telephone}"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -38,27 +38,27 @@
|
|||
<spring:url value="{ownerId}/edit.html" var="editUrl">
|
||||
<spring:param name="ownerId" value="${owner.id}"/>
|
||||
</spring:url>
|
||||
<a href="${fn:escapeXml(editUrl)}" class="btn btn-info">Edit Owner</a></td>
|
||||
<a href="${fn:escapeXml(editUrl)}" class="btn btn-info"><fmt:message key="editOwner"/></a></td>
|
||||
<td>
|
||||
<spring:url value="{ownerId}/pets/new.html" var="addUrl">
|
||||
<spring:param name="ownerId" value="${owner.id}"/>
|
||||
</spring:url>
|
||||
<a href="${fn:escapeXml(addUrl)}" class="btn btn-success">Add New Pet</a></td>
|
||||
<a href="${fn:escapeXml(addUrl)}" class="btn btn-success"><fmt:message key="addNewPet"/></a></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2>Pets and Visits</h2>
|
||||
<h2><fmt:message key="petsAndVisits"/></h2>
|
||||
|
||||
<c:forEach var="pet" items="${owner.pets}">
|
||||
<table class="table" style="width:600px;">
|
||||
<tr>
|
||||
<td valign="top" style="width: 120px;">
|
||||
<dl class="dl-horizontal">
|
||||
<dt>Name</dt>
|
||||
<dt><fmt:message key="petName"/></dt>
|
||||
<dd><c:out value="${pet.name}"/></dd>
|
||||
<dt>Birth Date</dt>
|
||||
<dt><fmt:message key="birthDate"/></dt>
|
||||
<dd><joda:format value="${pet.birthDate}" pattern="yyyy-MM-dd"/></dd>
|
||||
<dt>Type</dt>
|
||||
<dt><fmt:message key="type"/></dt>
|
||||
<dd><c:out value="${pet.type.name}"/></dd>
|
||||
</dl>
|
||||
</td>
|
||||
|
@ -66,8 +66,8 @@
|
|||
<table class="table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Visit Date</th>
|
||||
<th>Description</th>
|
||||
<th><fmt:message key="visitDate"/></th>
|
||||
<th><fmt:message key="description"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<c:forEach var="visit" items="${pet.visits}">
|
||||
|
@ -82,14 +82,14 @@
|
|||
<spring:param name="ownerId" value="${owner.id}"/>
|
||||
<spring:param name="petId" value="${pet.id}"/>
|
||||
</spring:url>
|
||||
<a href="${fn:escapeXml(petUrl)}">Edit Pet</a>
|
||||
<a href="${fn:escapeXml(petUrl)}"><fmt:message key="editPet"/></a>
|
||||
</td>
|
||||
<td>
|
||||
<spring:url value="/owners/{ownerId}/pets/{petId}/visits/new" var="visitUrl">
|
||||
<spring:param name="ownerId" value="${owner.id}"/>
|
||||
<spring:param name="petId" value="${pet.id}"/>
|
||||
</spring:url>
|
||||
<a href="${fn:escapeXml(visitUrl)}">Add Visit</a>
|
||||
<a href="${fn:escapeXml(visitUrl)}"><fmt:message key="addVisit"/></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -13,11 +13,17 @@
|
|||
<body>
|
||||
<div class="container">
|
||||
<jsp:include page="../fragments/bodyHeader.jsp"/>
|
||||
<h2>Owners</h2>
|
||||
<h2><fmt:message key="owners"/></h2>
|
||||
|
||||
<spring:message code="name" var="Name" />
|
||||
<spring:message code="address" var="Address" />
|
||||
<spring:message code="city" var="City" />
|
||||
<spring:message code="telephone" var="Telephone" />
|
||||
<spring:message code="pets" var="Pets" />
|
||||
|
||||
<datatables:table id="owners" data="${selections}" row="owner" theme="bootstrap2"
|
||||
cssClass="table table-striped" pageable="false" info="false" export="pdf">
|
||||
<datatables:column title="Name" cssStyle="width: 150px;" display="html">
|
||||
<datatables:column title="${Name}" cssStyle="width: 150px;" display="html">
|
||||
<spring:url value="/owners/{ownerId}.html" var="ownerUrl">
|
||||
<spring:param name="ownerId" value="${owner.id}"/>
|
||||
</spring:url>
|
||||
|
@ -26,10 +32,10 @@
|
|||
<datatables:column title="Name" display="pdf">
|
||||
<c:out value="${owner.firstName} ${owner.lastName}"/>
|
||||
</datatables:column>
|
||||
<datatables:column title="Address" property="address" cssStyle="width: 200px;"/>
|
||||
<datatables:column title="City" property="city"/>
|
||||
<datatables:column title="Telephone" property="telephone"/>
|
||||
<datatables:column title="Pets" cssStyle="width: 100px;">
|
||||
<datatables:column title="${Address}" property="address" cssStyle="width: 200px;"/>
|
||||
<datatables:column title="${City}" property="city"/>
|
||||
<datatables:column title="${Telephone}" xtitlekey="telephone" property="telephone"/>
|
||||
<datatables:column title="${Pets}" xtitlekey="pets" cssStyle="width: 100px;">
|
||||
<c:forEach var="pet" items="${owner.pets}">
|
||||
<c:out value="${pet.name}"/>
|
||||
</c:forEach>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
|
||||
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
|
||||
<%@ taglib prefix="petclinic" tagdir="/WEB-INF/tags" %>
|
||||
|
@ -28,18 +29,21 @@
|
|||
</c:choose>
|
||||
|
||||
<h2>
|
||||
<c:if test="${pet['new']}">New </c:if>
|
||||
Pet
|
||||
<c:if test="${pet['new']}"><fmt:message key="new"/> </c:if>
|
||||
<fmt:message key="pet"/>
|
||||
</h2>
|
||||
|
||||
<spring:message code="petName" var="Name" />
|
||||
<spring:message code="description" var="description" />
|
||||
|
||||
<form:form modelAttribute="pet" method="${method}"
|
||||
class="form-horizontal">
|
||||
<div class="control-group" id="owner">
|
||||
<label class="control-label">Owner </label>
|
||||
<label class="control-label"><fmt:message key="owner"/> </label>
|
||||
|
||||
<c:out value="${pet.owner.firstName} ${pet.owner.lastName}"/>
|
||||
</div>
|
||||
<petclinic:inputField label="Name" name="name"/>
|
||||
<petclinic:inputField label="${Name}" name="name"/>
|
||||
<petclinic:inputField label="Birth Date" name="birthDate"/>
|
||||
<div class="control-group">
|
||||
<petclinic:selectField name="type" label="Type " names="${types}" size="5"/>
|
||||
|
@ -47,10 +51,10 @@
|
|||
<div class="form-actions">
|
||||
<c:choose>
|
||||
<c:when test="${pet['new']}">
|
||||
<button type="submit">Add Pet</button>
|
||||
<button type="submit"><fmt:message key="addPet"/></button>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<button type="submit">Update Pet</button>
|
||||
<button type="submit"><fmt:message key="updatePet"/></button>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</div>
|
||||
|
|
|
@ -21,16 +21,16 @@
|
|||
</script>
|
||||
<div class="container">
|
||||
<jsp:include page="../fragments/bodyHeader.jsp"/>
|
||||
<h2><c:if test="${visit['new']}">New </c:if>Visit</h2>
|
||||
<h2><c:if test="${visit['new']}"><fmt:message key="new"/> </c:if><fmt:message key="visit"/></h2>
|
||||
|
||||
<b>Pet</b>
|
||||
<b><fmt:message key="pet"/></b>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Birth Date</th>
|
||||
<th>Type</th>
|
||||
<th>Owner</th>
|
||||
<th><fmt:message key="name"/></th>
|
||||
<th><fmt:message key="birthDate"/></th>
|
||||
<th><fmt:message key="type"/></th>
|
||||
<th><fmt:message key="owner"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
|
@ -41,23 +41,26 @@
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
<spring:message code="date" var="date" />
|
||||
<spring:message code="description" var="description" />
|
||||
|
||||
<form:form modelAttribute="visit">
|
||||
|
||||
<petclinic:inputField label="date" name="date" />
|
||||
<petclinic:inputField label="description" name="description" />
|
||||
<petclinic:inputField label="${date}" name="date" />
|
||||
<petclinic:inputField label="${description}" name="description" />
|
||||
|
||||
<div class="form-actions">
|
||||
<input type="hidden" name="petId" value="${visit.pet.id}"/>
|
||||
<button type="submit">Add Visit</button>
|
||||
<button type="submit"><fmt:message key="addVisit"/></button>
|
||||
</div>
|
||||
</form:form>
|
||||
|
||||
<br/>
|
||||
<b>Previous Visits</b>
|
||||
<b><fmt:message key="previousVisits"/></b>
|
||||
<table style="width: 333px;">
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Description</th>
|
||||
<th><fmt:message key="visit"/><fmt:message key="date"/></th>
|
||||
<th><fmt:message key="visit"/><fmt:message key="description"/></th>
|
||||
</tr>
|
||||
<c:forEach var="visit" items="${visit.pet.visits}">
|
||||
<c:if test="${!visit['new']}">
|
||||
|
|
|
@ -14,13 +14,16 @@
|
|||
<div class="container">
|
||||
<jsp:include page="../fragments/bodyHeader.jsp"/>
|
||||
|
||||
<h2>Veterinarians</h2>
|
||||
<h2><fmt:message key="veterinarians"/></h2>
|
||||
|
||||
<spring:message code="name" var="Name" />
|
||||
<spring:message code="specialties" var="Specialties" />
|
||||
|
||||
<datatables:table id="vets" data="${vets.vetList}" row="vet" theme="bootstrap2" cssClass="table table-striped" pageable="false" info="false">
|
||||
<datatables:column title="Name">
|
||||
<datatables:column title="${Name}">
|
||||
<c:out value="${vet.firstName} ${vet.lastName}"></c:out>
|
||||
</datatables:column>
|
||||
<datatables:column title="Specialties">
|
||||
<datatables:column title="${Specialties}">
|
||||
<c:forEach var="specialty" items="${vet.specialties}">
|
||||
<c:out value="${specialty.name}"/>
|
||||
</c:forEach>
|
||||
|
@ -31,10 +34,10 @@
|
|||
<table class="table-buttons">
|
||||
<tr>
|
||||
<td>
|
||||
<a href="<spring:url value="/vets.xml" htmlEscape="true" />">View as XML</a>
|
||||
<a href="<spring:url value="/vets.xml" htmlEscape="true" />"><fmt:message key="viewAsXml"/></a>
|
||||
</td>
|
||||
<td>
|
||||
<a href="<spring:url value="/vets.json" htmlEscape="true" />">View as JSon</a>
|
||||
<a href="<spring:url value="/vets.json" htmlEscape="true" />"><fmt:message key="viewAsJson"/></a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
Loading…
Reference in a new issue