In Play! 2.0 we can pass arguments to a i18n message like this:
In my view: (message.key = task.created with arguments: firstName and a code)
<div class="alert alert-success">
<a class="close" data-dismiss="alert">×</a>
@Messages("task.created", MyContext.currentUser().firstName, newTask.code)
</div>
My message is defined as:
task.created=<strong>{0}</strong>, your task has been saved with code {1}
I would like to see the firstName
with the HTML tag strong, but instead of applying the strong tag it just printing the strong
tag.
I hope you understand my question. Is this possible in Play or not?
Thanks!
Do it like this:
@Html(Messages("task.created", MyContext.currentUser().firstName, newTask.code))
I hope this can help you!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With