newuserpasswordtext using many languages

newuserpasswordtext using many languages

by luciano biondo -
Number of replies: 7
Newuserpasswordtext can be set in Site administration>Administration>Language>Language settings. I did it in all the language I need. I manually enroll people that use different languages: how can I say to Moodle in what language it should send the newuserpasswordtext, for each user enrolled?
Average of ratings: -
In reply to luciano biondo

Re: newuserpasswordtext using many languages

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

The preferred language of the user decides in what language he/she will receive the message.

In your case, the value you set on https://moodle.org/user/language.php?id=6511&course=1 decides in which language you receive password changing related emails.

In reply to Renaat Debleu

Re: newuserpasswordtext using many languages

by luciano biondo -
Thanks, but I have the problem yet. I'm the administrator. I create a new user. Where can I set the preferred language for that user? I didn't find this kind of setting in the profile page. Where is it?
In reply to luciano biondo

Re: newuserpasswordtext using many languages

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

It is on the user Preferences page.

In reply to Emma Richardson

Re: newuserpasswordtext using many languages

by luciano biondo -
This is useless in order to send to the user the mail with the password in the right language!!!

When you set the preference you need to already know the password, so you need to have already received the mail with the password from moodle... in *your* language.

I need to set the user's language *when* I create the user, not after the user has already received the mail with the password.
In reply to luciano biondo

Re: newuserpasswordtext using many languages

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Use the user bulk upload interface, eventually for adding only one user. There you can add the language (lang field) of the new user before the email is sent:

  • Required fields:

username,firstname,lastname,email

  • Optional fields: To provide values other than the default include one or more of these

institution,department,city,country,lang,auth,timezone,idnumber,icq,phone1,phone2,address,url,description,mailformat,maildisplay,htmleditor,autosubscribe

In reply to luciano biondo

Re: newuserpasswordtext using many languages

by Clarence Prudhoe -

Hi,

I agree with Luciano,  except the user should set his language preference before he creates a new account.  That way the new account instructions will be in his language.

If you choose to automatically use the language set in the user's browser, that language should be used in the account setup and should be saved to the user's database in the mdl_user/lang field.

If the user selects his language from the language drop list, then that language should be used in the account setup and should be saved to the user's database in the mdl_user/lang field.

It is OK to change that setting in the user's preferences, but it should be written to the database at the time of account setup.

Thanks,

Clarence

In reply to Clarence Prudhoe

Re: newuserpasswordtext using many languages

by Renaat Debleu -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

When a user creates a new account using self registration, the email with the password is sent in his/her own language.

This reminds me of an issue I raised with an additional plugin: registration with admin confirmation.  There the email to the admin user was sent in the language of the registrant.  Because you cannot expect that the admin understands every language, I asked the developer to update his code to send this email in the language of the admin user.

So one would expect that when an admin creates a new account using the French interface, the message is sent in French, when using German, the message is sent in German,...  But this is not happening, because the language is not (yet) set at that moment. 

Adding one line to the user/editadvanced.php file, should generate such an effect:

...
$usernew = $DB->get_record('user', array('id' => $usernew->id));
if ($createpassword) {
    ++$usernew->lang = $SESSION->lang;
    setnew_password_and_mail($usernew);
...