Hi. I have an English language Moodle 2.6 installation which I now need to make available in six different languages. I have installed the language packs for these languages, but cannot see an easy way to provide translated content for the custom message body of the "Is this your first time here" message for self-enrollment or the Site Summary (custom) Welcome message.
Tagging these messages in HTML for 6 languages would be very tedious and prone to error. Is there an easier way?
The easiest way to provide login instructions in several languages is by using the language customisation feature. Please see the section 'Instructions' in Managing authentication for details.
You can do the same for the self-enrolment welcome message by editing the welcometocoursetext language string.
Hi, thx for reply! I should have added to my post that I had tried this (and did Purge all caches), but it did not work - see screenshot below.
I have also tried filtering for welcometocoursetext language string, but that returns a lot of results, none of which seems to be the text I want? (screenshot attached).
I had assumed/hoped that it would be this type of approach, but it just doesn't seem to work?
I really appreciate the help on this...
It is of course possible to implement a little hack and have your Moodle pull those texts from customized language files instead of the database. It is probably a single-line change in the code but it surely requires massaging the language pack.
Thanks for that - seem unusual that the "Manage Authentication" option doesn't work tho ...
Robert, could you please provide some detail or link re: the suggested "little hack" - this sounds much more manageable than the multilang filter route ?
Well, the text from the input field is kept in the database and fetched from there into some variable then displayed after being run through the multilang filter. You need to find the line in code that displays that text and replace it with a line that recalls a string from the current language pack. You can find examples of that in the same function, I am pretty sure. If you have problems locating that, feel free to contact me by email.
Now, the tricky part is to get the strings in the language packs. I presume that you would prefer to be able to use the web interface to edit those strings (as local changes) since that makes things simpler on the long run. Besides, adding new strings to a language pack poses some issues. I would find an existing string that it not used on your site. It does not have to be in the moodle.php file. Just browse through your lang pack to find such a thing. Note its exact name and the name of the lang file it is in. Customize it for your needs in any language you want and recall in the hack above. You can store the reference to it in the admin panel, so it is documented.
This should work. You will just need to transfer this hack when you switch to a new major version of Moodle. If your Moodle is installed from git, you can merge minor updates without loosing your hack.
By the way, a request to move those instructions to language packs was turned down, cf. MDL-4477.
JK, sorry to hear you've not managed to get the language customization method to work, nor you Robert.
I've just tried editing the default login instructions in two languages on demo.moodle.net and found things working perfectly. (You're welcome to try too, as you can log in to the site as an admin, though you'll have to enable email self-registration.)
I subsequently added a note to Managing authentication though, which I think may be the reason why you found it not working.
Note: The instructions field must be left blank for the above method to work. Custom login instructions in English can be provided by editing the English language pack.
If you previously added text to the instructions field then you'll need to remove it, and if you're using a text editor, check in HTML mode that no br tag is left behind.
The same will apply when adding translations of the welcometocoursetext - the custom welcome message field must be left blank.
Thus, I hope you are now able to provide multi-lang versions of custom text. If the documentation needs clarifying further, please let us know.
Helen/Robert - I really appreciate your invaluable help! I'm almost there...
- I have sorted the "loginsteps" message. you were correct Helen - I had to delete the message that I had done in English thtough Manage Authentication. All is now good
- BTW (email-based self enrollment plugin is missing from sandbox)
- I cannot locate the strings identifier for the site summary page. It does not appear to be "welcometocoursetext" in moodle.php - I have tried that, but it remains blank on populating.
- for clarity, I have attached a screenshot from the sandbox of exactly the message I wish to be able to manage for translations.
- I have tried "&strings=1" in the URL to try and identify, but to no avail
- Any idea how I might progress?
- Is there a description anywhere of all the fields?
JK, sorry I misread your initial post when you mentioned self enrolment and a custom welcome message and thought you meant the email which is sent when someone self-enrols in a course (as described in the section 'Sending a welcome message to new users' in the documentation Self enrolment).
For the area you highlight in the screenshot, there is no default text. Thus the only way here is to use the Multi-language content filter as you originally thought, and as Robert has confirmed.
OK - Thanks for that Helen. Any chance that this could be considered for a future fix? It really is a gap in the who translation programme and I can't imagine I'm the only one who has had this problem....
Helen - you are a genius. Do you know how many people are searching for the issue regarding the "Is this your first time here?" message and its removal? Crazy hacks and theories all treating a symptom instead of the issue which you so eloquently cited. If you ever type anything into the authentication block dedicated to enabling a custom login message with the text editor and then remove it, it actually leaves a break code behind <br>. This remnant is ONLY VISIBLE by switching to HTML mode (<> symbol). Deleting it restores the login panel to its pristine condition - i.e. no "Is this the first time ..." message. I intend to go on a quest and supply this real solution to the posts wherever I can find them. Thanks!