What's new in 3.0 version
Compatibility 1.8
To be compatible with java 1.8, some methods of the class I18n were renamed (Migration guide).
Remove some deprecated mojos
Mojo jsp and tapestry were removed.
What's new in 2.5 version
Plugin was renamed to i18n-maven-plugin.
the plugin was renamed from maven-i18n-plugin to i18n-maven-plugin.
think to update your poms.
Add a struts2 jsp parser
this new parseur scan jsp files to extract keys which match these forms: text name='xxx' or label='xxx' or %{getText("xxx".
Unfortunatly, we can't do better than this, and still we detects too much keys. To avoid this problem we had a new paramter (see next section) to restrict accepted incoming keys.
anyway, always keep in mind that a good pratice is to use a common i18n prefix for all your keys, so the pattern should not be so harde to write ;)
Add a new parameter acceptKeyFormat on parser-like goals
This permits to limit incoming keys by a regex.
Can generate a csv file from the generated bundle for all locales.
This can help people to translate missing keys.
To use this just add *-Di18n.generateCsvFile* on the bundle mojo.
What's new in 2.4 version
Better usage of encodings
Since JDK 1.6, it is possible to load and store properties files using a given encoding, there is then no more reason to stay on a hardcoded encoding such as ISO-8859-1 or US/ASCII.
I18n integrates this changes and now it is more serious to use as default encoding UTF-8.
This encoding can be changed at two places:
- while generating files (by the i18n plugin) - at the runtime initialization of I18n class via the initializer (I18nInitializer).
Deal other syntax formats for translations
By default, I18n use the String.format syntax for translations.
By sometimes, we would like to use the i18n plugin to manage translations and their bundles, but use a different i18n runtime system base on MessageFormat (like does struts2 or GWT).
Version 2.4 allows now to change the syntax of translations at differents places:
- at generation time of the bundle using parameter bundleFormatConverter of bundle mojo. - at runtime time, by giving to the i18n initializer the correct messageFormatter to use. (see contract I18nMessageFormatter).
Note that at runtime time translations can not be swapped froma syntax to another one, using a different syntax from the one used by translations will not work properly.
What's new in 2.3 version
Version 2.3 improves a lot performance on detection of java file i18n keys (mojo parserJava).
See Evolution #1275: Improve parserJava performance.
We are now having some nice times (under 5 millisecondes for a file!) as shown below :
mvn package -Pnotests -Di18n.strictMode -DnuitonI18nVersion=2.2 [INFO] --- maven-i18n-plugin:2.2:parserJava (default) @ observe-business --- [INFO] Parsing is done. [treated file(s) : 76/187](total time:19.852s) ( ~ 106.158ms / file) [INFO] --- maven-i18n-plugin:2.2:parserJava (scan-sources) @ observe-swing --- [INFO] Parsing is done. [treated file(s) : 151/206](total time:38.732s) ( ~ 188.021ms / file) mvn package -Pnotests -Di18n.strictMode -DnuitonI18nVersion=2.3-SNAPSHOT [INFO] --- maven-i18n-plugin:2.3-SNAPSHOT:parserJava (default) @ observe-business --- [INFO] Parsing is done. [treated file(s) : 76/187](total time:640.602ms) ( ~ 3.426ms / file) [INFO] --- maven-i18n-plugin:2.3-SNAPSHOT:parserJava (scan-sources) @ observe-swing --- [INFO] Parsing is done. [treated file(s) : 151/206](total time:450.823ms) ( ~ 2.188ms / file)
What's new in 2.2 version
Version 2.2 just suppress the two depreciated methods in 2.1 version :
I18n._(String) I18n.n_(String)
We strongly suggest you to use directly this new version and not the 2.1 version to avoid some possible problems later (for example if a higer library or application use the version 2.2... Some linkage error will appear).
What's new in 2.1 version
News in maven plugin
It is now possible to generate a default locale (for example myTranslations.properties) using the generateDefaultLocale option in your pom.
A parserTapestry and parserGWTJava have been introduced. The GWT parser gathers all the keys identified by the annotation @Key. Coupling it with the XML Parser for UIBinder screens, you can manage all the translations of your application using nuiton-i18n.
News in api
It is now possible to specify the locale to use for a translation using the method l_ :
I18n.l_(Locale.FRANCE, "To translate");
So now it is possible to use I18n for some application like web one by passing the user's locale.
This new mode of translation required to review the initialisation of I18n, which is now simplier and improved. Some methods were depreciates and will be removed in version 3.0.
At the end (in version 3.0), only one init method should stay :
I18n.init(I18nInitializer, Locale);
Methods n_(String), _(String) has been depreciate and will also be removed in version 3.0.
What is new in the 2.0 version
Since 2.0 version, the generated i18n bundles (in src/main/resources/i18n) are compatible with the ResourceBundle Java API, meaning that we replaced all - by _.
Before we had
mylib-fr_FR.properties
And now it is :
mylib_fr_FR.properties
- Migration to 2.0 version
To use the 2.0 version, you first need to rename in your project the bundles with the new names (or they will be generated at first execution and you will be good for a copy/paste party. And anyway, it is best to rename existing files to keep the history in your version control system).
For the bundle mode (bundle mojo), no modification is necessary and it will be compatible with libraries package with older i18n versions (1.x).
- Add a JSP parser
A new JSP parserhas been introduced to integrate the i18n detection system in web developmments (using Struts for example).
Take a look to the tutorials to see how to enhance your application using Nuiton I18n.
- Improve XML parsers
The xml type parsers (at the moment we had only parserValidation) have seen their design improved. Some parameters have become common to all parsers. See the goal detail page to see what changed.
We introduced the new parserXml that contains no key detection rules, the user have to specify them by himself; this new mojo can allow key detection in xml files not managed by the project.
- Suppression of the I18n ant tasks module
This module is not maintained for a long time, so it has been unactivated in the default build. but it is still in the project and can be activated in a profile named ant-task-profile.
So to build the I18n project with this module, you just have to launch :
mvn install -Pextra-modules