Grails
  1. Grails
  2. GRAILS-8655

Grails I18N plugin does not set language cookie

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0 final
    • Fix Version/s: None
    • Component/s: Plugins

      Description

      Documentation about I18N (http://grails.org/doc/latest/guide/i18n.html) specifies:
      "Grails will automatically switch the user's locale and store it in a cookie so subsequent requests will have the new header."

      I18nGrailsPlugin.groovy:113 handles the 'lang' parameter but only uses a SessionLocaleResolver.
      The language cookie is never set.
      Should the LocaleResolver use a chain of SessionLocaleResolver and CookieLocaleResolver? For example: http://www.coderanch.com/t/60835/oa/Spring-CookieLocaleResolver-SessionLocaleResolver

        Activity

        Hide
        Arthur added a comment -

        Hello!
        Is there any changes related to this issue?

        Show
        Arthur added a comment - Hello! Is there any changes related to this issue?
        Hide
        Benoit Lemoine added a comment - - edited

        It's seems to work correctly with a cookie when the property localeResolver is overriden in resources.groovy.
        (Exemple : in my file resources.groovy, I've added

         localeResolver(org.springframework.web.servlet.i18n.CookieLocaleResolver) {
                defaultLocale = Locale.FRANCE
        
                java.util.Locale.setDefault(defaultLocale)
            })
        

        Maybe it could be usefull to add this information in the documentation.

        Show
        Benoit Lemoine added a comment - - edited It's seems to work correctly with a cookie when the property localeResolver is overriden in resources.groovy. (Exemple : in my file resources.groovy, I've added localeResolver(org.springframework.web.servlet.i18n.CookieLocaleResolver) { defaultLocale = Locale.FRANCE java.util.Locale.setDefault(defaultLocale) }) Maybe it could be usefull to add this information in the documentation.

          People

          • Assignee:
            Unassigned
            Reporter:
            Eric Rodriguez
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Last Reviewed:

              Development