Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

helpers.translate() not working

SadikA344125392
ServiceNow Employee
ServiceNow Employee
<sys_ux_client_script action="INSERT_OR_UPDATE">
<includes/>
<macroponent display_value="Watch topics">d6f8cbf5e736201068c30b63c2f6a9d1</macroponent>
<name>Refresh Event Sucess Callback</name>
<required_translations>[ {
"message": "The Watch Topic refresh is in progress. Please check Refresh Status after some time."
} ]</required_translations>
<script><![CDATA[/**
* @Param {params} params
* @Param {api} params.api
* @Param {any} params.event
* @Param {any} params.imports
* @Param {ApiHelpers} params.helpers
*/
function handler({
api,
event,
helpers,
imports
}) {
api.setState("refreshStatus", "in_progress");
helpers.translate("The Watch Topic refresh is in progress. Please check Refresh Status after some time.").then((value) => {
api.emit("NOW_UXF_PAGE#ADD_NOTIFICATIONS", {
items: [{
"id": "alert-succeded-to-resolve",
"status": "info",
"icon": "info-circle-outline",
"content": value,
"action": {
"type": "dismiss"
}
}]
});
});
}]]></script>
<script_api_version>2.0.0</script_api_version>
<sys_class_name>sys_ux_client_script</sys_class_name>
<sys_created_by>admin</sys_created_by>
<sys_created_on>2022-12-14 15:50:22</sys_created_on>
<sys_id>843dda89197b1110f877e171dd1ce98b</sys_id>
<sys_mod_count>5</sys_mod_count>
<sys_name>Refresh Event Sucess Callback</sys_name>
<sys_package display_value="Vulnerability Response" source="sn_vul">054cdcc2ff200200158bffffffffff94</sys_package>
<sys_policy/>
<sys_scope display_value="Vulnerability Response">054cdcc2ff200200158bffffffffff94</sys_scope>
<sys_update_name>sys_ux_client_script_843dda89197b1110f877e171dd1ce98b</sys_update_name>
<sys_updated_by>admin</sys_updated_by>
<sys_updated_on>2025-07-16 16:24:38</sys_updated_on>
<type>default</type>
</sys_ux_client_script>



Has anyone encountered a similar issue or knows what might be causing the translation function to not work correctly in UI Builder client scripts?
1 REPLY 1

GlideFather
Tera Patron

Hi @SadikA344125392,

you said:

"but the translations are not appearing in the UI"

 

could you please be more specific about your issue?

———
/* If my response wasn’t a total disaster ↙️ drop a Kudos or Accept as Solution ↘️ Cheers! */