GRAILS Plugin : JMesa

10 views
Skip to first unread message

AMRAOUI Marouane

unread,
Jul 2, 2009, 5:34:24 AM7/2/09
to JMesa
Hi,

In grails i can change the localisation like this :

if the default browser language is FR i can change it in grails
controller :
def key =
"org.springframework.web.servlet.DispatcherServlet.LOCALE_RESOLVER"
def localeResolver = request.getAttribute(key)

localeResolver.setLocale(request, response, new Locale("en", "EN"))

And All i18n message will be in english.

the i18n message for plugin JMesa take always the localisation defined
in the browser !!!

how can i change the localisation of this plugin.

Thanks

Jeff Johnston

unread,
Jul 3, 2009, 12:34:53 PM7/3/09
to JMesa
The plugin is supported by the community as I do not use Grails myself
right now.

What I am able to tell you is that you can set the Locale on the
WebContext. So if you pull the WebContext from the TableFacade then
you can set the Locale. Although ideally the Locale would be set when
building the TableFacade using the
TableFacadeFactory.createSpringTableFacade() if Spring has a hook to
it. You will also have to define a US bundle file and hook it into the
Messages.

http://code.google.com/p/jmesa/wiki/Messages

Your timing is interesting as someone else was asking about this. Here
was the conversation and the solution.
http://code.google.com/p/jmesa/issues/detail?id=201&can=1&start=100

In general the Grails plugin has fallen behind the releases. This is
mostly because the developer that originally wrote the plugin is busy,
and I have not learned Grails yet. Lately I have been learning Antlr
for another project so I am not sure when I will be able to learn
Grails. Although people seem to be generally happy with the plugin....

I really should send out a shout to the community and see if anyone is
interested in updating the plugin. In general JMesa has been very
stable and I am sure it would not be that much work. It would be
really slick if the build was automated as well to fit in with the
current build system. For the build I use Groovy and Ant, as I do love
the Groovy!

-Jeff Johnston


On Jul 2, 4:34 am, AMRAOUI Marouane <amraoui.marou...@gmail.com>
wrote:

AMRAOUI Marouane

unread,
Dec 17, 2009, 10:46:15 AM12/17/09
to jm...@googlegroups.com
Hello,

Sorry but i tried to do your solution but i couldn't resolve this probleme of changing the localisation. Because i use the Tag JMesa and not API JMEsa in my gsp page. 
The tag JMesa initilize the TableFacade (i looked the source code). so how can i set the Local in webcontext for the tableFacade initilized in the Tag Jmesa ?

Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JMesa" group.
To post to this group, send email to jm...@googlegroups.com
To unsubscribe from this group, send email to jmesa+un...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jmesa?hl=en
-~----------~----~----~----~------~----~------~--~---


Jeff Johnston

unread,
Dec 17, 2009, 5:12:05 PM12/17/09
to JMesa
Does that code (localeResolver) pull the messages from the Spring
framework? If so you should be able to define the JMesa resource
attributes in Springs MessageSource handling. If you use the
<springTableFacade> tag in place of the <tableFacade> tag to integrate
with Spring.

If that does not work then you would need to enhance the
TableFacadeTag class to be able to accept a Locale and set it on the
WebContext. I had that in the eXtremeTable project but it did not seem
that useful so I just left it out of JMesa.

-Jeff Johnston


On Dec 17, 9:46 am, AMRAOUI Marouane <amraoui.marou...@gmail.com>
wrote:


> Hello,
>
> Sorry but i tried to do your solution but i couldn't resolve this probleme
> of changing the localisation. Because i use the Tag JMesa and not API JMEsa
> in my gsp page.
> The tag JMesa initilize the TableFacade (i looked the source code). so how
> can i set the Local in webcontext for the tableFacade initilized in the Tag
> Jmesa ?
>
> Thanks.
>

> > jmesa+un...@googlegroups.com <jmesa%2Bunsu...@googlegroups.com>

Reply all
Reply to author
Forward
0 new messages