i18n - how to pass variable and html code in message | Community
Skip to main content
New Participant
Mar 23, 2018 11:07 AM UTC
Solved

i18n - how to pass variable and html code in message

So I need to do something like:
Here is my message with inner_variable, ok.

inner_variable gonna be set in js and I need styles for it.

I tried something like:

.html

${'message' @ i18n, format='<span class="email-address__text"></span>'}

.xml

sling:message="Here is my message with {0}, ok."

But the span works like text and I can't set any values. Any suggestions?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
smacdonald2008
smacdonald2008Accepted solution
Level 10
Mar 23, 2018 2:27 PM UTC

Where are you defining the variable in {}.

THis does not look right. IN HTL - normally these objects are set on Java backend (ie - sling models) or JS USE API.

1 reply

smacdonald2008
smacdonald2008Accepted solution
Level 10
Mar 23, 2018 2:27 PM UTC

Where are you defining the variable in {}.

THis does not look right. IN HTL - normally these objects are set on Java backend (ie - sling models) or JS USE API.

Translate