You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "Taack (via GitHub)" <gi...@apache.org> on 2025/06/14 07:04:50 UTC

[I] 7.0.0-M4: MessageSource raise NoSuchMessageException on non-default message bundle [grails-core]

Taack opened a new issue, #14815:
URL: https://github.com/apache/grails-core/issues/14815

   ### Expected Behavior
   
   When creating new message bundle, like `message_action.properties`, `messageSource` should find translations defined in this bundle.
   
   
   
   ### Actual Behaviour
   
   Here, a `NoSuchMessageException` exception is raised after `hello.label` which is translated in `message_action.properties` and `message_action_fr.properties`.
   
   ```bash
   ❯ curl http://localhost:8080/test/testTrOk
   Edit⏎                                                                                                                                                                                           
   ~
   ❯ curl http://localhost:8080/test/testTrKo
   <!doctype html>
   <html>
       <head>
           <title>Grails Runtime Exception</title>
   
   ```
   
   ```groovy
   @GrailsCompileStatic
   class TestController {
       TestTrService testTrService
   
       def testTrKo() {
           // defined in message_action.properties bundle
           render testTrService.tr('hello.label')
       }
   
       def testTrOk() {
           // defined in message.properties (the default bundle)
           render testTrService.tr('default.button.edit.label')
       }
   }
   
   ```
   
   
   ### Steps To Reproduce
   
   1. `./gradlew server:bootRun`
   2. `curl http://localhost:8080/test/testTrOk` => returns the tranlation
   3. `curl http://localhost:8080/test/testTrKo` => raise an exxception
   
   
   
   ### Environment Information
   
   ```bash
   ❯ .jdks/openjdk-24.0.1/bin/java -fullversion
   openjdk full version "24.0.1+9-30"
   
   ❯ uname -a
   Linux cachyos-x8664 6.15.2-2-cachyos #1 SMP PREEMPT_DYNAMIC Tue, 10 Jun 2025 13:25:03 +0000 x86_64 GNU/Linux
   
   ```
   
   ### Example Application
   
   _No response_
   
   ### Version
   
   7.0.0-M4


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 7.0.0-M4: MessageSource raise NoSuchMessageException on non-default message bundle [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on issue #14815:
URL: https://github.com/apache/grails-core/issues/14815#issuecomment-2972865000

   From what I can tell, this has worked like this since 2014.  The specific code is here: https://github.com/apache/grails-core/blob/d03aa57fb552e3ab3e57ad7240f76e7be78b375e/grails-core/src/main/groovy/org/grails/spring/context/support/PluginAwareResourceBundleMessageSource.java#L146 
   
   I don't view this as a bug.  If you can show me this was working in previous Grails versions, I can investigate further.  Otherwise, I'm closing this ticket for now.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 7.0.0-M4: MessageSource raise NoSuchMessageException on non-default message bundle [grails-core]

Posted by "Taack (via GitHub)" <gi...@apache.org>.
Taack commented on issue #14815:
URL: https://github.com/apache/grails-core/issues/14815#issuecomment-2973009354

   I prefer the new way, this is not a bug, even if it was working previously. Intellij support message bundle using a '_'. I will test if it works the same way 
   
   Regards


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 7.0.0-M4: MessageSource raise NoSuchMessageException on non-default message bundle [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty commented on issue #14815:
URL: https://github.com/apache/grails-core/issues/14815#issuecomment-2972864082

   If you rename message_action to messageAction it will work.  Grails assumes the last _ is a language, so when you define message_action ,it's assuming that's for the language "action" which does not exist.  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] 7.0.0-M4: MessageSource raise NoSuchMessageException on non-default message bundle [grails-core]

Posted by "jdaugherty (via GitHub)" <gi...@apache.org>.
jdaugherty closed issue #14815: 7.0.0-M4: MessageSource raise NoSuchMessageException on non-default message bundle
URL: https://github.com/apache/grails-core/issues/14815


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org