I built a rule using rules module to create a node of a certain content type which inserts a text of
full_html format inside a
body field when
follow flag is flagged. This is the rule
$values = array( 'type' => 'notification', 'uid' => UID_OF_A_USER, 'status' => 0, 'comment' => 0, 'promote' => 0, 'language' => 'en' ); $entity = entity_create ('node', $values); $ewrapper = entity_metadata_wrapper('node', $entity); $url = "PROFILE_URL_OF_A_USER"; $uname = "USERNAME_OF_A_USER"; $link = l("$uname","$url"); $body_content = t("!link started following you.",array('!link' => $link)); $ewrapper->field_body->set(array('value' => $my_body_content ,'format'=>'full_html') ); $ewrapper->save();
When a user uses
Follow flag to follow another user, a message is sent to the followed user which says,
!link started following you.
This rule works perfectly but the problem is with translation of the
!link started following you.. My website supports three languages. This is the problem:
If a user (flagging user) flags another user using
Follow flag and he is in a certain language, say french, The above message in french language will be sent to the followed user, no matter in what language the followed user is viewing his profile, he will see this message in french language and by switching language it will not be translated.
I need this message to be translated in the current language of flagged user when he is viewing its profile but the message is sent in the language of the flagging user and in the profile page of the followed user will not be translated even if he switches the language.
How can I make this message translatable?