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

3

10

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?

Fosque answered 17/6, 2010 at 20:31 Comment(1)
Any luck with finding solution?Stav
H
1

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.

Hobard answered 29/8, 2011 at 10:59 Comment(0)
A
1

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!

Apsis answered 4/7, 2012 at 3:6 Comment(0)
J
0

I implemented the Message Compiler for this purpose, which creates the resource bundle files and constant definitions as Java enum for the keys from one single source file. So the constants can be used in the Java source code, which is a much safer way. The message compiler cannot only be used for Java. It creates also resource files and constants for Objective-C or Swift and can be extended for other Programming environments.

Joni answered 19/1, 2016 at 15:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.