Force language of a mail
| Project: | Mail Editor |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Hi,
I am developing a little helper module to address some language issues drupal has.
http://drupal.org/project/reglang
Your module is the only solution I see to translate user notification mails.
http://drupal.org/node/369305
But right now Drupal is not using the correct language for some emails especially user notifications.
http://drupal.org/node/378560
Maybe you could add a setting to your module that make the admin set that if a user is inside the mail array its language will be used.
You use mail_edit_mail_alter but only use the currently set language $arg[] = $mail['language']->language;
In RegLang I check id the given $message you call it $mail has a user set $message['params']['account']->language
If it is set and the admin set an option for this mail you could load the users preferred language and set it to the mail.
<?php
//Line 396
if(!empty($mail['params']['account']->language) && variable_get('some_option', FALSE)) {
$arg[] = user_preferred_language($mail['params']['account']);
}
else {
$arg[] = $mail['language']->language;
}
?>I hope I make clear what I mean :)
I think it would be really useful if your module tackles this issue directly. RegLang has to call your hook_mail_alter again as those hooks have no weight and I don't like the solution.
Please think about if it would be a good addition to the module. I can make a patch for this but it will take some time as I am quiet busy.
Yours,
Kars-T
