UI Messages translation on client script

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2022 03:42 AM
Hi all,
I see that is possible handle U Message translation also in client scripts.
If on server side I use the command
gs.getMessage('MY KEY');
I can use the ${} notation both on HTML and client script
HTML
<h1>${'MY KEY'}</h1>
Client Script
var message = ${'MY KEY'};
But my question is, how right handle on client side the messages key that contains parameters?
On server side I can use this notation:
gs.getMessage('Hi {0}, {1}', ['Mark', 'Good afternoon'] );
There is something similar on client side?
Which is the best approach for this kind of sentences on client side?
I need to handle them inside a service portal widget.
Thanks
Labels:
- Labels:
-
Service Portal Development
5 REPLIES 5

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2022 12:42 AM
Thanks Michele,
I misread that, I thought you are talking about catalog client script.
Best Regards
Aman Kumar
Aman Kumar