Translate String in an UI Policy with addDecoration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 03:08 AM
"Hello everyone, I need to translate the string inside this g_form.addDecoration to another language. How can I do that? Using sys_translated and sys_translated_text doesn't seem to work. Any ideas?"
Below my Script
function onCondition() {
g_form.addDecoration("u_asset_is_requested_for_return" , "icon-mail", "Waiting for confirmation for the return from the user", "color-yellow");
}
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 03:13 AM
HI,
You need to use message table. -> Message table (servicenow.com)
You can store the messages in different languages and you have to fetch the message using the key. It will display based on user's language.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 04:02 AM
Hi Anurag,
thanks for your Reply.
With ShowfieldMessage the translation work fine, but with the string inside the addDecoration, doesnt work. Maybe we can't translate the message on hoover on icon ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 04:05 AM
have you tried translating the message first and then pass to the add decoration function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2023 07:42 AM
Yes, but doesn't work. I think isn't possibile to translate a string inside the g_formAddDecoration. So i have cancelled that, thank for your support.