We have a simple velocity template, and would like to include a paragraph of text which contains a little bit of markup (e.g. <strong> tags around single words within the paragraph.). Using $i18n.getText, the htmk is rendered to the page as text. Is it possible to enable markup? It doesn't make sense to break the paragraph down into smaller properties with the html in the velocity template, as the word order could be different in different langages.
The property is something like this:
myplugin.admin.description=The variables <em>{0}</em> and <em>{1}<\em> may be used to substitute the ...
Thanks!
Community moderators have prevented the ability to post new answers.
Velocity is set to autoescape all output unless the variable name as a Html suffix. You should be able to set the contents of the i18n.getText to a variable and then output it.
for example
#set($messageHtml = $i18n.getText('my.i18n.key'))$messageHtml
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you considered using Closure Templates, aka Soy Templates, as an alternative to Velocity? Stash uses Soy Templates internally, and incorporates nice support for i18n within templates via the stash_i18n macro.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nice out of the box good answer mate! #like #lots
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.