Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tool for checking Java resource bundles (i18n) [closed]

I'm searching for a tool, ant-task, IDE plugin, ... which helps with I18N of a Java application using the standard message-properties resource bundles. Both open source and commercial solutions are welcome.

Specifically I'm searching for support in the following tasks:

1) Extract the used keys from Java-code, JSPs and other artifacts. Since custom frameworks are involved the extraction should allow customization.

Mapping of the source artifact to a certain message bundle. Also with custom rules.

Report used keys which are not in the bundle. Report keys which are in the bundle but in none of the source artifact which map to this bundle.

2) Check the property files of each bundle and report missing key definitions and also default translations (uses the English text).

3) Compare the current SVN/CVS/GIT/whatever version with an old version and report cases where one translation (or maybe only the default one) changed but not the other translation.

http://rscbundlecheck.sourceforge.net/ covers 2) to a large part. However I didn't found something for 1) and 3). Any pointers?

like image 382
rfalke Avatar asked Jun 17 '10 20:06

rfalke


2 Answers

Report used keys which are not in the bundle. Report keys which are in the bundle but in none of the source artifact which map to this bundle.

You know, this one is quite untypical and I doubt any framework would include it, since it requires analysing code and determining, which calls are to resource bundle, which can be dynamic strings passed as arguments etc.

Normally the bundles are edited using dedicated editor, f.g. ResourceBundle plugin for Eclipse, in which you edit original and translation simultanously, and you see warnings for each key not present in all translations.

like image 66
Stepan Vihor Avatar answered Nov 15 '22 13:11

Stepan Vihor


1) Extract the used keys from Java-code, JSPs and other artifacts. Since custom frameworks are involved the extraction should allow customization.

Mapping of the source artifact to a certain message bundle. Also with custom rules.

I've also faced those same issues and started developing a new solution. I just posted it today in my blog. It just uses the Java annotation processor tool to create (or just update) properties files and keys. It is also extensible, as described in the post. And it is available in my GitHub project (you will have to find the link from my blog, as I cannot post more than 2 links).

Feel free to use it and ask whatever you need.


2) Check the property files of each bundle and report missing key definitions and also default translations (uses the English text).

I have also found this solution (haven't tried it yet), and it sounds promising!


Hope it helps!

like image 31
rvcoutinho Avatar answered Nov 15 '22 14:11

rvcoutinho