Activity Stream @Mention Email wrong language

Victor53
Tera Contributor

Hello,

 

The email notification that's being sent to the user whenever he is mentioned in a record, is always translated to a specific language (let's say french, whatever). The mail script uses a couple of gs.getMessage() calls, the messages are present in the sys_ui_message table, but no matter the user or his language preference, it's always translated. I was able to log the user and the session language that runs the email scripts. It's System, and the language is fr, which is different from the instance default language. Why doesn't it take into account the user that's mentioned, and always picks up the System user language. Has anyone had a similar issue ?

1 ACCEPTED SOLUTION

AnveshKumar M
Tera Sage
Tera Sage

Hi @Victor53 

You can use gs.getMessageLang() instead of gs.getMessage(), where you can specify the language you want. For example,

 

gs.getMessageLang('hello', 'en'); //English

gs.getMessageLang('hello', 'fr'); //French

 

If you want it to be more dynamic based on the user, you can glide the user record and get his/her language preference and pass it to the function.

 

Please mark my answer helpful and accept as a solution if it helped 👍✔️

Thanks,
Anvesh

View solution in original post

1 REPLY 1

AnveshKumar M
Tera Sage
Tera Sage

Hi @Victor53 

You can use gs.getMessageLang() instead of gs.getMessage(), where you can specify the language you want. For example,

 

gs.getMessageLang('hello', 'en'); //English

gs.getMessageLang('hello', 'fr'); //French

 

If you want it to be more dynamic based on the user, you can glide the user record and get his/her language preference and pass it to the function.

 

Please mark my answer helpful and accept as a solution if it helped 👍✔️

Thanks,
Anvesh