On the client side, I would like to have a string that says "X's stuff".
I want X to be the username, with colors.
The backend notifications system already does this, but I don't know how to achieve this on the client side.
What's the correct way to implement this, while having a simple string without HTML exposed to translators?
Can I something like this? Are usernames guaranteed to be sanitized?
I want X to be the username, with colors.
The backend notifications system already does this, but I don't know how to achieve this on the client side.
What's the correct way to implement this, while having a simple string without HTML exposed to translators?
Can I something like this? Are usernames guaranteed to be sanitized?
Code: Select all
elem.innerHTML = dojo.string.substitute(
_("${player_name}'s stuff"),
{player_name: `<span style="color:#${player.color}">${player.name}</span>`});