multilang done 1,000 times more efficient, more comprehensive, more flexible

Re: multilang done 1,000 times more efficient, more comprehensive, more flexible

by Ray Morris -
Number of replies: 2

Damyon, I'm not sure which of three things you're wanting.  Two are included in the CSS I suggested, the other I've never seen implemented anywhere.  I think you're wanting the first case, which is included.   This is easy:

<div lang="en-us">Flashlight</div>

<div lang="en">Torch</div>


That's the last bit I mentioned in my initial post "the most specific language first (the en-us version would come before the generic en version, unless they are one and the same)."


You can also do this, where multiple languages have the same text:

<div lang="en es">soda</div>

<div lang="fr">soudeo</div>



Are you saying you'd like to do this?:

Write text in Spanish and in English.

Some users see the Spanish text.

Some users see the English text.

Some users see BOTH the Spanish and the English.


Indeed I don't think that's supported in Moodle, and if it's supported in HTML I'd like to see a reference for it.  The specs I've read gives a list of languages by PRIORITY, and it uses the ONE language with the highest priority.


In reply to Ray Morris

Re: multilang done 1,000 times more efficient, more comprehensive, more flexible

by Damyon Wiese -
No - I specifically DO NOT want any hijacking of the HTML5
syntax. It exists to mark sections of a document as being in a different language to the rest of the text and the browser uses this information to e.g. show the text in a different font.

There are valid cases where you DO want text in Spanish and English and you always want all users to see all the text (Like a spanish course for english students).

We must not try use the lang attribute to hide any text - it must be a different syntax like the class or {{multilang}} or something else.

(I am trying to be very clear).
Average of ratings: Useful (1)
In reply to Damyon Wiese

Re: multilang done 1,000 times more efficient, more comprehensive, more flexible

by Michael Milette -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

I agree Damyon. Here is an example that we often come across.

From time to time, we need to add to a page the name of a business, product or publication which is officially only French or in English. It would be inappropriate to translate these name so we need to use the HTML5 lang="xx" syntax to ensure that these words are pronounced correctly by screen readers.

If we were to hijack the HTML5 syntax, we would no longer be able to meet this accessibility requirement.

Best regards,

Michael