grails message as argument of other message

604 views Asked by At

I have this for example in my i18n messages_es.properties

birds.label=Aves
mammals.label=mamiferos
reptiles.label=reptiles

default.no.items.found=No se encontraron {0}

And then I want to use the message, inside the template argument in my Grails .gsp Views:

<g:message code="default.no.items.found" args="<g:message code='birds.label'/>"/>

This of course doesn't work. But is there a way to make this simple? Avoid overriding the "no found message" or defining an extra variable.

1

There are 1 answers

1
Joshua Moore On BEST ANSWER

The solution to your issue is quite simple. You're trying to call a nested tag library from another but you're not quite doing it right:

<g:message code="whatever" args="${message(code: 'somethingelse')}" />

Doing this should solve your issue.