Grails: How to include an html link inside a <g:message> default attribute?

Posted by Christoph on Stack Overflow See other posts from Stack Overflow or by Christoph
Published on 2010-05-05T16:47:43Z Indexed on 2010/05/06 0:48 UTC
Read the original article Hit count: 477

Filed under:
|

Hi, I am starting with Grails and want to have one page with multilanguage content.

I started using the tag which works fine. But here is what I want to do:

I want to include the default text of the default language right in the text, to avoid switching back and forth in between files.

<g:message code="homepage.feature.headline1" default="This is an english text" />

The above works.

But now I a have a message which should include a link like this:

<g:message code="homepage.feature.headline1" default="This is an english text with <a href='somefile.html'>a link</a>" />

This gives me an exception:

org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: Grails tags were not closed! [[<g:message>]] in GSP 

How can I achieve that I can include a link there? I have tried escaping the <> brackets but still no luck. I really would like to avoid splitting up this one sentence into multiple smaller sentences.

Thanks Christoph

© Stack Overflow or respective owner

Related posts about grails

Related posts about i18n