« Return to Thread: When exactly is the locale changed when using the lang parameter?

Re: When exactly is the locale changed when using the lang parameter?

by Jean-Noël Rivasseau-3 :: Rate this Message:

Reply to Author | View in Thread

> My name isn't Graeme, but I can confirm that SessionLocaleResolver is
> used. You can find out what Spring beans are used by looking inside
> I18nGrailsPlugin.

OK. Well, Peter, you're our second Graeme on the MLs :)

>
>> In particular, does the constraints allow the URL mapper resolver to
>> discriminate on a optional parameter?
>>
>> Eg, for the mapping:
>>
>>  "/$lang?/$controller/$action?"
>> {
>>   constraints
>>  {
>>      lang(matches:/[a-z]{2}/)
>>   }
>> }
>>
>> will the code checks if I have a 2 letter string after the first
>> slash, in that case fill the $lang parameter, and in the other case
>> assume the $lang parameter is not present? I am not sure if such
>> advanced conditional mappings currently work with Grails.
>
> I'm afraid I don't know, but I don't think you can even have an option
> parameter appearing ahead of a required one.

I came to the same conclusion. However apparently if you put two
mappins, one with the lang parameter and the other without, it works
fine. So it's ok for me

Thanks Peter,

Jean-Noel

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: When exactly is the locale changed when using the lang parameter?