Can Rich Text component in UI builder be translatable?

james_kail
Giga Expert

I am wondering if "Rich Text" component in UI builder can be "translatable". We have 15 languages in our instance that we support. We are looking to create a new Portal using UI builder. In our testing we have a test page with a rich text component on it. (see below)

find_real_file.png

 

 In service portals we built prior to UI builder, we could add an HTML widget to the page 

find_real_file.png

In the HTML we would point it to a message in sys_ui_message table as shown below.  

find_real_file.png

Then in the sys_ui_message table we would have an entry for each language we wanted to have the HTML translated to.

find_real_file.png

This way when the user viewed the Portal page the HTML would be in there language. 

 

Question: 

Is there a way to translate the UI Builder "Rich Text" component?
NOTE: I am looking for translating text in "UI Builder Rich Text Component" for a Portal Page.  


(I was hoping to avoid having to add a separate rich text component for each language and hiding or showing based on the user's language).   

1 ACCEPTED SOLUTION

I have gotten a reply on how to do the translations. It turns out to be rather simple solution. 

Solution: Create a message in sys_ui_message for each language you want to translate the Rich Text to. need to make sure to include any "html" tags in the message. 

 

To test out the solution

  1. Added a new Rich text component (Rich text 5)

    find_real_file.png

  2. I then edited the content of the HTML to set it to a "my_translated_rich_text".

    Notice at the bottom of the Rich Text box, there is a "p", this is the HTML tag that Servicenow added to what I typed in the box. 

    Note: If you bold or Italicize, you will notice that the text string at the bottom changes. My recommendation would be to leave as simple as possible and not add any other formatting to the text. Do all your formatting in the message stored in the sys_ui_message table.  
    find_real_file.png
  3. I then created entries in sys_ui_message for the "string" for the languages I wanted. 

    find_real_file.png
  4. The key point for the messages created above is that the "Key" needs to contain the html tag(s). Notice in point 2 at the bottom there is a "p". This is the HTML tag (<p>) that needs to be included in the Message key in the sys_ui_message table.   

    English

    find_real_file.png
    Italian

    find_real_file.png


  5. Run the site as an English user, notice text at bottom is in English

    find_real_file.png


  6. Change user's language to Italian, notice the text at bottom was translated.

    find_real_file.png

*** Message key needs to include the HTML tag(s) from the rich text element in the UI Builder. 

View solution in original post

8 REPLIES 8

james_kail
Giga Expert

I have opened a case in HI with ServiceNow. Initial feedback from them is that there may be a know issue with translating this record type. Initial estimate is that Rome Patch 7 may address the issue. I will provide an update when I get more details from ServiceNow. 

@james.kail 

You shouldn't need to create sub-pages / cloned pages per language - it should be an API call either as the entity as a whole or certain strings within it (e.g. text between chevrons). Feel free to email me with the case number and I'll check up on it,

 

Many thanks,
Kind regards

--------------------------------------------------------------------
Director of Globalization Deployment, Internationalization

I have heard back from ServiceNow. They have identified a problem PRB1532752 and have targeted San Diego release for correction. They are looking to backport the fix to ROME Patch 7, but nothing definite has been stated/done. 

I have gotten a reply on how to do the translations. It turns out to be rather simple solution. 

Solution: Create a message in sys_ui_message for each language you want to translate the Rich Text to. need to make sure to include any "html" tags in the message. 

 

To test out the solution

  1. Added a new Rich text component (Rich text 5)

    find_real_file.png

  2. I then edited the content of the HTML to set it to a "my_translated_rich_text".

    Notice at the bottom of the Rich Text box, there is a "p", this is the HTML tag that Servicenow added to what I typed in the box. 

    Note: If you bold or Italicize, you will notice that the text string at the bottom changes. My recommendation would be to leave as simple as possible and not add any other formatting to the text. Do all your formatting in the message stored in the sys_ui_message table.  
    find_real_file.png
  3. I then created entries in sys_ui_message for the "string" for the languages I wanted. 

    find_real_file.png
  4. The key point for the messages created above is that the "Key" needs to contain the html tag(s). Notice in point 2 at the bottom there is a "p". This is the HTML tag (<p>) that needs to be included in the Message key in the sys_ui_message table.   

    English

    find_real_file.png
    Italian

    find_real_file.png


  5. Run the site as an English user, notice text at bottom is in English

    find_real_file.png


  6. Change user's language to Italian, notice the text at bottom was translated.

    find_real_file.png

*** Message key needs to include the HTML tag(s) from the rich text element in the UI Builder.