UI Messages translation on client script

Michele22
Tera Contributor

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

5 REPLIES 5

Thanks Michele, 

I misread that, I thought you are talking about catalog client script.

 

Best Regards
Aman Kumar