Book Image

Spring MVC Beginner's Guide

By : Amuthan Ganeshan
Book Image

Spring MVC Beginner's Guide

By: Amuthan Ganeshan

Overview of this book

Table of Contents (19 chapters)
Spring MVC Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – adding internationalization


Technically, we can add as much language support as we want for internationalization, but for demonstration purposes, I am going to show you how to make an add product page for Dutch language support. Perform the following steps:

  1. Create a file called messages_nl.properties under /src/main/resources in your project, add the following lines in it, and save the file:

    addProduct.form.productId.label = Nieuw product ID
    addProduct.form.name.label = Naam
    addProduct.form.unitPrice.label = Prijs unit
    addProduct.form.description.label = Beschrijving
    addProduct.form.manufacturer.label = Manufacturer
    addProduct.form.category.label = Fabrikant
    addProduct.form.unitsInStock.label = Aantal op voorraad
    addProduct.form.condition.label = Product Staat
    addProduct.form.productImage.label = Product image
  2. Open the addProduct.jsp page and add the following set of tags right after the logout link:

    <div class="pull-right" style="padding-right:50px">
      <a href="?language...