how can I translate a string into a business rule?

fabrizio95360
Tera Expert

In this business rule I would like to translate the string "Integration error in GoSign case"

 

(function executeRule(current, previous /*null when async*/) {

	gs.addErrorMessage(gs.getMessage('Integration error in GoSign case')+ current.number);
	current.work_notes = 'Error in GoSign integration';

})(current, previous);

 

I have already put the string in the messages. but it does not work. 

Anyone have any ideas?

 

3 REPLIES 3

Harsh Vardhan
Giga Patron

@fabrizio95360  Have you checked this KB Article ? Let me know if it does not work. 

 

Business Rule Message isn't being Translated 

 

Thanks,

Harsh

@Harsh Vardhan  yes, I followed those steps but it doesn't work

@fabrizio95360  May i know how are you testing it ?

 

if you are using gs.getMessage() then user language should be exact same language which you want to translate , eg: if you want to convert the message into Spanish then current user should have default Spanish language on his profile.   

 

If you don't want to change on user profile language then you can use gs.getMessageLang();

 

gs.getMessageLang("New email", "es");

 

 

Doc link for further details.

https://developer.servicenow.com/dev.do#!/reference/api/vancouver/server_legacy/c_GlideSystemAPI#GS-... 

 

Let me know if you have any questions for me.

 

Thanks,

Harsh