changing text language

changing text language

by Robert Brenstein -
Number of replies: 3
Is it possible, and if yes, how, to have the descriptions and instructions that I enter as administrator to change when user changes the language?

Very specifically, I am using pop3 authentication. The configuration panel for it includes a text block with info for users. Great except that I need to have this text in multiple languages not just the one I entered in the web interface. I want people using English, see it in English, and people using German, see it in German.
Average of ratings: -
In reply to Robert Brenstein

Re: changing text language

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Sure.  Enable the multilang filter in Admin >> Config >> Filters.

Then type your text like this:

<span lang="en">English stuff here</span>
<span lang="de">Deutsche stuff here</span>

The <span> syntax is new in 1.5.   Earlier versions used this tag instead, but it caused some problems in the editor:

<lang lang="en">English stuff here</lang>
<lang lang="de">Deutsche stuff here</lang>
In reply to Martin Dougiamas

Re: changing text language

by Robert Brenstein -
I am using 1.4.4 so I need to take a risk with the lang tag. Is there a way to specify default? I mean a text to display when a given language version is not provided?

<lang lang="fr">French stuff here</lang>
<lang lang="de">Deutsche stuff here</lang>
<lang lang="pl">Polish stuff here</lang>
<lang lang="">English stuff here, for any other language</lang>
In reply to Robert Brenstein

Re: changing text language

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
The logic is like this:

  1. If your chosen language is found in the mulittext, then that is used.
  2. If the parent language of your chosen language is found, then that is used.
  3. If English (en) is found in the multitext, then that is used.