Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to enable markup in i18n.properties in stash plugin

anorakgirl May 22, 2013

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!

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
jhinch _Atlassian_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 23, 2013

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

anorakgirl May 28, 2013

Thanks for the answer!

1 vote
David Pinn
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 23, 2013

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.

anorakgirl May 28, 2013

Thanks for the suggestion, will try this when I get a chance.

Ellen Feaheny [AppFusions]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 31, 2013

Nice out of the box good answer mate! #like #lots

TAGS
AUG Leaders

Atlassian Community Events