-
Notifications
You must be signed in to change notification settings - Fork 9
Home
Here, you will hopefully find the information you need to start using I18N4Vaadin 2.0 in your applications.
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.
I18N4Vaadin is licensed under the Apache License 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.
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.
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.
You can use I18N4Vaadin in both CDI-enabled Vaadin applications and standard Vaadin applications. Instructions for both approaches are found here:
- 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