In some projects, I use the classical ResourceBundle
mechanism to grab locale-dependent messages (exception messages, informational messages, whatever).
But I have a few problems with it:
- it is too "heavyweight" for my tastes; for instance, while I only need strings, a
ResourceBundle
can return anObject
; - handling of non existing keys is poor (unchecked exception instead of returning the key itself);
- you can stack bundles, however not in the way I'd like (adding a parent using
.setParent()
does not make the parent searched first, but the child).
I know code can be written to overcome the two latter points; however, if there is a library out there for handling messages in a more simple way, it would be even better! Do you know of one?