I noticed on our FR/EN site that the FR user registration emails were not in the user's language.

a little digging and could see that user module actually does create these tokens using a $language object.. which is good, but this language object comes from the user object and their preferred language.

A little more digging and i see that since we are using logintoboggan and it overrides the user register submit function it would be trivial to have this module set the user's preferred language to the lang the site was in when the user submitted his registration.

this patch does that.

CommentFileSizeAuthor
logintoboggan-set_users_lang.patch639 bytesliquidcms
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Pasqualle’s picture

Title: set user's preferred language [patch provided] » set user's preferred language
Category: feature » bug
Status: Active » Reviewed & tested by the community

this is a bug, as there is no way to change the language of registration emails, they are always sent in English.
but it is a bug in Drupal 6 core also #163165: Multilanguage support for user emails..

hunmonk’s picture

Version: 6.x-1.9 » 7.x-1.x-dev
Category: bug » task
Status: Reviewed & tested by the community » Postponed

i have examined LT's user register function and compared it to core's matching function -- there are no differences that would cause a problem with this functionality. cross examining #163165: Multilanguage support for user emails, it appears there was a patch that made the necessary change to core's user.module register function: http://drupal.org/files/issues/drupal.user-register-language.patch

however, the final committed patch did not contain the user.module changes: http://drupal.org/files/issues/d7.163165.user-register-language-v03.patch

i suggest somebody try to straighten out what's going on in that issue first. :) because LT has to overtake core's user register function, i model LT's function after core's to achieve the same workflow with LT's enhancements.

so, make core's register function do what you need, then reopen this issue and i'll port over the changes. same goes for the 6.x version.

Pasqualle’s picture

in D7 the language is set correctly in locale.module on line 282

function locale_language_selector_form(&$form, &$form_state, $user) {
  global $language;
...
  // If the user is being created, we set the user language to the page language.
  $user_preferred_language = $user->uid ? user_preferred_language($user) : $language;

...
  $form['locale']['language'] = array(
    '#default_value' => $user_preferred_language->language,

The user object contains the correct default language before the registration mail is sent..

ok, so let's start with D6 core

hunmonk’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev

so then this needs to be postponed, but for 6.x only it sounds like...

kenorb’s picture

Issue summary: View changes
Status: Postponed » Closed (outdated)

Closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.