Book Image

Vaadin 7 Cookbook

Book Image

Vaadin 7 Cookbook

Overview of this book

Table of Contents (19 chapters)
Vaadin 7 Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Internationalizing Vaadin in Grails


We have set up a new Grails project with Vaadin in Chapter 1, Creating a Project in Vaadin. Now let's have a look at how to perform localization.

We will see how to use the i18n method, which is provided by the Vaadin plugin. In order to do that, we will create a simple application, showing a few texts that will be localized. The first screen on the left-hand side in the following screenshot is localized in the Swedish language. The second one, on the right-hand side, is localized in the English language.

Getting ready

Make sure you have a project using the latest stable version of Grails and Vaadin.

Use grails list-plugin-updates to get the list of updates for the plugins installed in the project. Alternatively, just run grails install-plugin vaadin and a new version of the plugin will be installed.

We will place the code in the following section directly into the init method inside the MyUI class. The MyUI class is the generated class by Vaadin plugin, inside...