How to create a message in a defined language?

Created on 20 January 2014, over 10 years ago
Updated 15 January 2024, 6 months ago

I'd like to know if it is possible to create a message with a defined language (and not with the current site language)?

I've made a custom function (a callback for a rule), but it doesn't seem to work...

function create_message_with_language($my_user, $my_language, $my_message_type){
$values['type'] = $my_message_type;
$values['user'] = $my_user;
$values += array(
'language' => $my_language,
);
$my_message = entity_create('message', $values);
return array('message_with_language' => $my_message);
}

💬 Support request
Status

Closed: outdated

Version

1.9

Component

Documentation

Created by

🇮🇹Italy salvatore_severo Foggia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024