Free DNS provides easy shared DNS hosting & URL forwarding

Monday, May 3, 2010

Customizing Moodle login instructions on a per language basis

Today I installed another language in one of my Moodle sites. On this occasion I noticed that the login instructions that I setup in the Moodle admin settings are being displayed in Romanian whatever language the user selects.
More precisely, in order to tell users to check their spam/bulk folder for the registration email that the site sends, I frequently customize the auth_instructions setting on the /admin/settings.php?section=manageauths page. In it, I copy the original message, which I get from the HTML source of the login page, and then I customize it to suit my needs.
When I setup a custom message, the original message is no longer displayed; which is very well. The problem is that when a user switches to another language (e.g. English), the customized message still appears (in Romanian). In order to fix this "problem", I removed the customized message from the site setting (ie. leaving it blank) and I moved it in the moodle.php language file for Romanian. This is quite easy to do: just go to /admin/lang.php?mode=compare&currentfile=moodle.php&currentstr=loginsteps#loginsteps and paste the HTML for your message (the one you had customized before in the site setting).
Note: If you did not apply the patch I describe in Click-to-translate feature for Moodle then loading the string editing page will take some time. Be patient!

No comments:

Post a Comment