In Grails, I would like to get a ConfigObject reference to the loaded messages properties file for the current locale. Or some way to easily read in the messages properties (for the current locale) in it's entirety. I want to convert it to JSON and send it back to the client to be used to lookup strings via javascript.
In essence I want to do something like this:
def props = new java.util.Properties()
props.load(... the right message bundle ...);
def messages = new ConfigSlurper().parse(props)
render messages as JSON
I'm assuming there's a more graceful way to do this. The messageSource interface only allows you to get a message for a particular key. I want the entire resource bundle so I can convert it to JSON.