- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2024 01:43 AM
Question:
I have been tasked with localizing static error messages in ServiceNow to support multiple languages. Instead of using hardcoded strings for error messages, how to implement a solution to fetch the messages from a language-sensitive resource file.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2024 01:51 AM
Hello @SandeepKSingh
The static error messages should be localized to support multiple languages. Use ServiceNow’s g_i18n.getMessage() method to fetch messages stored in a language-sensitive resource file instead of hardcoded strings.
Example:
gel('error_msg').innerHTML = g_i18n.getMessage("Contract End date should not be empty, Please select a contract's End date.");
To add these messages, navigate to System UI > Messages in ServiceNow, and create entries for each of the required strings (e.g., "Contract start date should not be empty, Please select a contract's start date.").
More Details :- https://docs.servicenow.com/bundle/xanadu-api-reference/page/app-store/dev_portal/API_reference/i18N...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2024 01:51 AM
Hello @SandeepKSingh
The static error messages should be localized to support multiple languages. Use ServiceNow’s g_i18n.getMessage() method to fetch messages stored in a language-sensitive resource file instead of hardcoded strings.
Example:
gel('error_msg').innerHTML = g_i18n.getMessage("Contract End date should not be empty, Please select a contract's End date.");
To add these messages, navigate to System UI > Messages in ServiceNow, and create entries for each of the required strings (e.g., "Contract start date should not be empty, Please select a contract's start date.").
More Details :- https://docs.servicenow.com/bundle/xanadu-api-reference/page/app-store/dev_portal/API_reference/i18N...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2024 02:08 AM
This worked thanks 🙂