Translation - Alert Messages

kali
Tera Contributor

Hi All,

I am using alert message in the onsubmit client script but when i am created a record in the message table the value is not getting translated when using getMessage() , please help me how we can translate it 

Thanks in advance

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@kali 

this worked for me

it should work for you as well

function onLoad() {
    //Type appropriate comment here, and begin script below
    getMessage("This is my alert", function(msgString) {
        alert(msgString);
    });

}

58.png56.png

Output

55.png

💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏

View solution in original post

4 REPLIES 4

Ankur Bawiskar
Tera Patron

@kali 

this worked for me

it should work for you as well

function onLoad() {
    //Type appropriate comment here, and begin script below
    getMessage("This is my alert", function(msgString) {
        alert(msgString);
    });

}

58.png56.png

Output

55.png

💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏

@Ankur Bawiskar - Thanks it is working now

Tanushree Maiti
Tera Patron

Hi @kali 

 

Refer : Client Script 'Messages' and System UI > Messages

If this script is running inside the Service Portal or Workspace environments, the standard synchronous getMessage('key') syntax often returns the key instead of the translated value on the first try.

 

Refer: KB0696905 client script function getMessage() does not return expected translated text on Service Po... 

 

Resolution

This is a sample code that would work with the Example given in the Symptoms section of this article. Replace the "alert(getMessage('Test : English version'))" by the following:
getMessage('Test : English version', function(msg){alert(msg);});