A Maven plugin to validate localization resources in Java properties files
The localization process of an application often involves non technical people. Some translated resources may contain issues linked to formatting, encoding, or the context where the resource is used.
l10-maven-plugin can validate a set of properties files (mainly used in Java ResourceBundle). It aims to either:
- Detect invalid l10n properties resources at build time, typically before the webapp is packaged, or when extracting properties files from a localization tool/database ([l10n:validate goal](https://github.com/rquinio/l10n-maven-plugin/wiki/l10n:validate goal)).
- Build a Maven site report listing violations found on properties ([l10n:report goal](https://github.com/rquinio/l10n-maven-plugin/wiki/l10n:report goal)), see a sample report.
The plugin was initially developed for some webapps translated in 7 languages with several thousands of properties across 5 resource bundles. It allowed to prevent buggy translations from slipping into production and reduced the cost of fixing them by detecting issues earlier.
It aims to be a pragmatic solution when having legacy constraints or needing fast & easy tool, yet probably not the ideal solution in terms of usability:
- Some checks could rather be performed as soon as translator uploads/inputs the translation in the localization tool, to provide instant feedback.
- Encoding/escaping should rather be managed by the code using the resources, based on the context they are being used (server side, client side, ...) rather than in the resources themselves.
See Usage page for plugin goals and detailed configuration.
Plugin is available on Maven Central, through Sonatype OSS hosting.
<plugin>
<groupId>com.googlecode.l10n-maven-plugin</groupId>
<artifactId>l10n-maven-plugin</artifactId>
<version>1.8</version>
</plugin>
The following specifies the minimum requirements to run this Maven plugin:
Library | Min version | Notes |
---|---|---|
Maven | 2.2.1 | Might work on previous Maven 2 versions, but not tested. |
JDK | 1.5 |
See the list of validators and associated checks.
- java.util.Properties#load Javadoc
- java.text.MessageFormat and java.util.Formatter Javadoc.
- Javascript special characters
- java.util.Pattern Javadoc
- JSON specification