nicgutierrez
11 years agoAce
How to use text.format
Hello. I'm working on a custom component and I'm trying to use text.format to localize the copy. Here's the sentence that I need to localise: <h4>${notification.target.actor.login} @mention...
- 11 years ago
Hi nicgutierrez
you can definitely use placeholders in your text keys and pass appropriate variables when you use them
For example , if you defined custom-text-key = "My name is {0}"
Then what you can do is:
<#assign myName = "Slim Shady"> ${text.format("custom-text-key",myName)}
Or even having multiple placeholders and so on ...
Hope it helps!