Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.
Petter Holmström edited this page Oct 1, 2013 · 14 revisions

Welcome to I18N4Vaadin 2.0

Here, you will hopefully find the information you need to start using I18N4Vaadin 2.0 in your applications.

What is I18N4Vaadin?

I18N4Vaadin is a small and simple add-on for making it easier to localize Vaadin applications. By using I18N4Vaadin, you do not have to implement a new localization system for every application and you can even change the language of your application on the fly without having to restart it.

Licensing

I18N4Vaadin is licensed under the Apache License version 2.0.

What is new in Version 2.0?

Version 2.0 is a complete rewrite that has very little in common with 1.0. Version 2.0 has been primarily designed to be used in CDI-enabled Vaadin 7 applications, even though it is also possible to use it in non-CDI applications.

The biggest new feature is an annotation processor (inspired by NetBeans) that automatically generates bundles for the default language. You define the default language strings using annotations directly in your code, and then access them using a special bundle-class that contains methods for each string in the bundle. Thus, you no longer have to deal with situations where a bundle resource key has been misspelled and the compiler will warn you if you change a bundle without changing your code.

What about Vaadin 6 support?

Vaadin 6.0 is not supported. If you need it, feel free to fork this repository and implement it yourself (it is not difficult to do, but I don't plan to do it).

Version 1.0 is still available in the V6 branch on GitHub.

How do I get I18N4Vaadin 2.0?

You can download I18N4Vaadin here on GitHub.

For your convenience I have also deployed I18N4Vaadin to my GitHub Maven repository. Add the following repository to your POM:

<repository>
  <id>peholmst-github-releases</id>
  <url>https://github.com/peholmst/maven-repo/raw/master/releases</url>
</repository>

After that, you can add the necessary dependencies:

<!-- API -->
<dependency>
  <groupId>com.github.peholmst.i18n4vaadin</groupId>
  <artifactId>i18n4vaadin-api</artifactId>
  <version>2.0.0</version>
</dependency>

<!-- CDI support -->
<dependency>
  <groupId>com.github.peholmst.i18n4vaadin</groupId>
  <artifactId>i18n4vaadin-cdi</artifactId>
  <version>2.0.0</version>
</dependency>
<!-- Annotation processor -->
<dependency>
  <groupId>com.github.peholmst.i18n4vaadin</groupId>
  <artifactId>i18n4vaadin-cdi-ap</artifactId>
  <version>2.0.0</version>
  <scope>provided</scope>
</dependency>

<!-- Implementation without CDI -->
<dependency>
  <groupId>com.github.peholmst.i18n4vaadin</groupId>
  <artifactId>i18n4vaadin-simple</artifactId>
  <version>2.0.0</version>
</dependency>
<!-- Annotation processor -->
<dependency>
  <groupId>com.github.peholmst.i18n4vaadin</groupId>
  <artifactId>i18n4vaadin-simple-ap</artifactId>
  <version>2.0.0</version>
  <scope>provided</scope>
</dependency>

To compile the source code downloaded from GitHub, you need to use Maven. Just issue mvn clean install and you should be good to go.

How do I use I18N4Vaadin 2.0 in my applications?

You can use I18N4Vaadin in both CDI-enabled Vaadin applications and standard Vaadin applications. Instructions for both approaches are found here:

Where is the demo?

  • CDI version: Source code (the UI looks and behaves exactly the same as the non-CDI version so I have not created a separate deployment for this demo)
  • Non-CDI version: Source code - Try it out