How to do translation on "HTML widget" -service portal

Sin
Giga Expert

Hi all. 

I knew that we can do translation on service portal using gs.getMessage();

 

Now I got struck on HTML out of the box widget(widget name: HTML)

find_real_file.png

How can I do translation for the highlighted text? where to write the "gs.getMessage()" scripe on this widget?

Please share some knowledge.

Thanks in advance!!

3 REPLIES 3

Sri Harsha3
Tera Expert

I think you need to write a macro and print it. 

aymericb
Kilo Expert

Hi,

When you write html in Service Portal, for translation use the syntax ${}. It is equivalent to gs.getMessage()

Example :

<a href="https://my.link.com">${Click here}</a>

The string "Click here" must be created in table sys_ui_message for each languages used.

More information here:

https://serviceportal.io/localization-service-portal/

https://docs.servicenow.com/bundle/madrid-servicenow-platform/page/build/service-portal/concept/c_Wi...

Regards

Hi! This worked for me!! Thank you!