Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any library for clean code generation from i18n resource bundles? [closed]

In my project I would like to have compile time checks on my existing resource bundle. I already have a set of *.properties localized files and I'm about to hook them up to some i18n tool. I was thinking about regular ResourceBundles, but I don't like the fact, that this mechanism does not guarantee any kind of checks, neither compile-time or maintenance checks like - finding duplicates or finding unused keys.

So, I'm looking for a library, which would take my existing *.properties files and converted them into neat and clean Java code, which I could use in my project.

The best possible outcome would be to have a mechanism similar to GWT i18n support. One, clean interface with all messages as a separate methods.

I have looked at jlibs and ForgeRock. I really like jlibs, but it's not a separate lib, so it's hard for me to imagine introducing so huge lib dependency just for i18n. ForgeRock does pretty much what I would like, but it produces constants rather than clean interfaces to work with, like jlibs does.

This entry blog is also helpful in understanding which approach I would like to use. I made a big research regarding available i18n tools, I just cannot find 'that one', which would suit my needs the best.

Regards.

like image 950
ŁukaszBachman Avatar asked Nov 25 '22 01:11

ŁukaszBachman


1 Answers

Another library satisfying your requirements of code generation would be i18n-binder.

Personally, I would approach this problem from another angle, using the gettext framework you would mark translatable strings in the source code and generate the resource bundles from them. There are tools and editors that can then update the translations based on the extracted strings, and detect no longer used or modified strings.

like image 87
Jörn Horstmann Avatar answered Dec 06 '22 23:12

Jörn Horstmann