Grails: How to enable html link inside the default <g: message> attribute?
I start with Grails and want to have one page with multilingual content.
I started using a tag that works great. But here is what I want to do:
I want to include the text of the default text in the default text to avoid switching between files.
<g:message code="homepage.feature.headline1" default="This is an english text" />
The above work.
But now I have a message that should contain 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 tried to get out of the brackets <>, but still no luck. I really would like to avoid dividing this sentence into several smaller sentences.
Thanks Christoph
2 : , . . ( ):
packagesUpdate.error.server.unreachable=The packages repository server "{0}" is unreachable. This usually happens behind a network proxy server.
packagesUpdate.error.server.proxyReplace=network proxy server
, , ref msgWithLink:
def msg = message(code: 'packagesUpdate.error.server.unreachable') def proxyReplace = message(code:'packagesUpdate.error.server.proxyReplace') def msgWithLink = msg.replace(proxyReplace, "<a href='/csvn/packagesUpdate/available'>${proxyReplace}</a>")g: message:
< g: var = "msg" value = "$ {message (code: 'packagesUpdate.error.server.unreachable')}" /" >
< g: var = "proxyReplace" value = "$ {message (code: 'packagesUpdate.error.server.proxyReplace')}" /" >
< g: var = "link" value = "$ {proxyReplace}" /" >
< g: var = "msgWithLink" value = "$ {msg.replace(proxyReplace, link)}" /" >