Q: Help!!! (How) can I translate this? A: Have you... - ServiceNow Community
Mark Roethof
Tera Patron
Tera Patron

Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Hi there,

 

Trying to translate some words or phrases, or just after changing some English wording. Already hours spend on it, not finding where to go, and getting crazy? Or just editing all kinds of scripting to achieve this?

There might be an easier/better way…

 

"Help!!! (How) can I translate this?"


I18N Debugging

That's it, applying I18N Debugging. Oke, there's a bit more explanation needed. Though my first go-to, would almost always be applying I18N Debugging. This approach solves the majority of ServiceNow Community questions every week posted on this.

 

I18N Debugging is available when the "I18N: Internationalization" plugin is activated (out-of-the-box active for recent instances). Simply navigate to "System Localization > Enable I18N Debugging". This enables translation prefixes on field labels for the current user session.

 

find_real_file.png

 

Using the I18N Debugging will "Debug translated strings in the UI, show translation prefixes before the strings. These prefixes indicate which strings can be translated and which table contains the string and translations."

 

The prefixes and tables are described really well on the Docs. I've listed them here also:

 

TRF Translated Name / Fields [sys_translated]  System Localization > Translated Names / Fields
MSG Messages [sys_ui_message]  System Localization > Messages
GMLD Field Label [sys_documentation] System Localization > Field Labels
TRT Translated Text [sys_translated_text] System Localization > Translated Text
CHC

Choice [sys_choice]

 


Examples

Oke, so how does this look like, what can we do with this? Some examples to help you get going!


Service Portal

find_real_file.png

 

Here an image of the out-of-the-box Service Portal index page with I18N Debugging enabled. Notice the translation prefixes on a lot of places, in this case mostly MSG and TRT.

 

So if you are after translating for example "How can we help?" place to be would be TRT, Translated Text. Would this be the first thing you would think of? Personally I would have had a look at Messages or the Service Portal widget code itself… though using I18N Debugging instantly shows you where you should be at.

 

Navigating to the Translated Text table and perform a search, would give you something like (or if missing, you could add this):

 

find_real_file.png

 

In this specific case, the Service Portal also used Instance options, with which you could easily change the English wording used.

Virtual Agent web client

find_real_file.png

 

Here an image of the Virtual Agent web client that displays a custom greeting topic with I18N Debugging enabled. Notice the translation prefixes on most of the messages, in this case MSG.

 

So if you are after translating for example "Good afternoon Mark." the place to be would be MSG, Messages. Most like the key for this would be "Good afternoon", "Good afternoon {0}", or "Good afternoon {0}.". Here's an image of the Message involved:

 

find_real_file.png

 

Also notice that the second message is not prefixed. So this would indicate… that you can't translate this one using Message, Translated Text, etc.. In this case this is also correct, on purpose I scripted this message without using gs.getMessage() or gs.getMessageLang().

 

find_real_file.png

 

Another image of the Virtual Agent web client which displays a custom greeting topic with I18N Debugging enabled. I18N Debugging is also helpful to spot words and phrases which cannot be translated. Like explained in the previous message. This image also shows some other areas which cannot be translated. For example you might want to have the Chat Header translated? No go. Or what about the month on the Date Picker, a recently asked question on the community. No go.

Idea Portal

find_real_file.png

 

Here an image of a small part from the Idea Portal with I18N Debugging enabled. A recently asked question on the community concerned if/how it would be possible to translate the categories. Notice that "All categories" is prefixed, though the categories themselves ("Compliance Project", "Human Resource/Employee Engagement", etcetera) are not! This would indicate that the categories themselves are not translateable, that the widget (or depending artifacts) have not been set up to support translations. While digging into the Service Portal widget, I indeed confirmed that this was not set up to support translations out-of-the-box 😞 A slight mistake from ServiceNow, though with using I18N Debugging quickly already discovered the issue mentioned in the community post.


Visual Task Board

find_real_file.png

 

The last example, haven't had any questions on this before, though just to give you an idea. Here an image of a Vusal Task Board with I18N Debugging enabled. The Visual Task Board code cannot be accessed/edited, this concerns the $vtb.do page. Though can we translate some of the words or phrases on it? As highlighted in the image, a lot can be translated even though you cannot access/edit the code of the Visual Task Board.


Recap

By adding some simple I18N Debugging, you could quickly pinpoint what you go to might be in your search for translating words or phrases. Instead of assuming its Messages, directly editing scripting, or wondering why something is not translatable… and eventually after spending hours on this, posting it on the ServiceNow Community, maybe waiting again some hours or even days before someone pinpoints your issue… apply I18N Debugging first!

---

If any questions or remarks, let me know!

 

C

If this content helped you, I would appreciate it if you hit bookmark or mark it as helpful.

 

Interested in more Articles, Blogs, Videos, Podcasts, Share projects I shared/participated in?
- Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Kind regards,


Mark Roethof

ServiceNow Technical Platform Architect @ Quint Technology

2x ServiceNow Developer MVP

2x ServiceNow Community MVP

---

LinkedIn

8 Comments