Translate Location Germany Value which is displayed on user profile in service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 09:57 AM
Hi Everyone,
I have a requirement where I should translate the word Germany which is shown for users with Germany as Location in User Profile on Service Portal. But Servicenow did not provide translations for cmn_location table. So how can we write a script on user table such that this can work for only Germany Word ? The translation for only Germany should be done and not touching other values in the table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2025 11:52 PM
This is not allowed in our project. I tried to do widget scripting. This is also not working. Please find below script.
if($scope.data.sysUserModel && $scope.data.sysUserModel.location){
var locationmap = {
'Germany' : 'Deutschland'
};
if(locationmap[$scope.data.sysUserModel.location]){
$scope.data.sysUserModel.location = locationmap[$scope.data.sysUserModel.location];
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 12:15 AM
did you try to create record into this table "sys_translated_text" for your language?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 12:34 AM
Yes. I tried this. It is nor working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 12:42 AM
Easiest way is to change the field type from String to Translated Text and system will do the work for you
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2025 01:51 AM
create a message in Messages table
then add this line in cloned widget to get the translated value
getMessage("Your Message Key here", function(msg){
alert(msg);
});
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader