Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I18nAutoConfiguration #13847

Open
wants to merge 8 commits into
base: 7.0.x
Choose a base branch
from

Conversation

codeconsole
Copy link
Contributor

@codeconsole codeconsole commented Nov 18, 2024

Resolves

Overriding bean definition for bean 'localeResolver' with a different definition: replacing [Root bean: class=null; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; fallback=false; factoryBeanName=org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration; factoryMethodName=localeResolver; initMethodNames=null; destroyMethodNames=[(inferred)]; defined in org.springframework.web.servlet.config.annotation.DelegatingWebMvcConfiguration] with [Generic bean: class=org.springframework.web.servlet.i18n.SessionLocaleResolver; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; fallback=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null]
Overriding bean definition for bean 'messageSource' with a different definition: replacing [Root bean: class=null; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; fallback=false; factoryBeanName=org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration; factoryMethodName=messageSource; initMethodNames=null; destroyMethodNames=[(inferred)]; defined in class path resource [org/springframework/boot/autoconfigure/context/MessageSourceAutoConfiguration.class]] with [Generic bean: class=org.grails.spring.context.support.PluginAwareResourceBundleMessageSource; scope=singleton; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; fallback=false; factoryBeanName=null; factoryMethodName=null; initMethodNames=null; destroyMethodNames=null]

Continuing the process, but going about it slowly not to break anything...

@matrei
Copy link
Contributor

matrei commented Nov 18, 2024

This branch currently fails in grails-functional-tests.

     void "Test that switching language results in correct encodings"() {
         when:"the show page is rendered in german"
             go "/book/show/1?lang=de"
             println driver.pageSource
         then:"The language is correct"
             $('a', class:'create').text() == 'Book anlegen'
             $('input', class:'delete').@value == 'Löschen'
     }
BookFunctionalSpec > Test that switching language results in correct encodings FAILED
    Condition not satisfied:

    $('a', class:'create').text() == 'Book anlegen'
    |                      |      |
    |                      |      false
    |                      |      11 differences (8% similarity)
    |                      |      (New-) (Book---)
    |                      |      (Book) (anlegen)
    |                      New Book
    [[[RemoteWebDriver: chrome on linux (aa76a1c57b7adbe2700eb5afe06537b6)] -> css selector: a.create]]
        at functionaltests.BookFunctionalSpec.Test that switching language results in correct encodings(BookFunctionalSpec.groovy:31)

@codeconsole
Copy link
Contributor Author

codeconsole commented Nov 18, 2024

This branch currently fails in grails-functional-tests.

@matrei
try now. It was getting localResolver from somewhere else that inherited WebMvcConfigurationSupport

Looks like it was because of this:

if(ClassUtils.isPresent('jakarta.servlet.ServletContext', classLoader)) {
GrailsASTUtils.addAnnotationOrGetExisting(classNode, ClassHelper.make(classLoader.loadClass('org.springframework.web.servlet.config.annotation.EnableWebMvc')))
}

@codeconsole
Copy link
Contributor Author

#13843

@matrei matrei self-requested a review November 18, 2024 09:58
Copy link
Contributor

@matrei matrei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to my tests, Grails 7 built from this branch currently passes grails-functional-tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants