A more flexible version of multilang filte

A more flexible version of multilang filte

by Germán Valero -
Number of replies: 7
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Vanyo Georgiev posted in this Moodle forum: https://moodle.org/mod/forum/discuss.php?d=243673 , about a  more flexible version of multilang filter, hosted at https://github.com/vanyog/multilangsecond:

This filter is a more flexible version of multilang filter.
It has an admin setting filter_multilangsecond_mode. 
If this setting is set to true non html syntax can be used for multilang blocks like

{mlang en}English{mlang}{mlang bg}Bulgarian{mlang}

Otherwise language block is a serie of identical html tags with lang="XX" atributes:

<h1 lang="en">Heading in English</h1>
<h1 lang="bg">Heading in Bulgarian</h1>

or

<p lang="en" style="...">Paragraph in English</p>
<p lang="bg" class="...">Paragraph in Bulgarian</p>
<p lang="ro">Paragraph in Romanian</p>

The old syntax with <lang> tags is valid too.

Please, try the filter and give him some feedback.
Average of ratings: -
In reply to Germán Valero

Re: A more flexible version of multilang filte

by Yedidia Klein -
Picture of Plugin developers

looks very nice, will it work also on user full name ?

I'll try it...

In reply to Yedidia Klein

Re: A more flexible version of multilang filte

by Vanyo Georgiev -

Hi Yedidia,

Whether a filter will work on a particular text depends on the PHP code of the page that displays the text. If the text is not passed to any filter no filter will work.

I am afraid that the full names of users are not filtered on Moodle pages.

 

In reply to Vanyo Georgiev

Re: A more flexible version of multilang filte

by Mihai Bojonca -
Picture of Testers

Dear Vanyo i am very happy for your develppment. 

I have a question.

Will it work with the WYSIWYG text editor or only HTML ?

 

Thanks. 

In reply to Mihai Bojonca

Re: A more flexible version of multilang filte

by Vanyo Georgiev -

Hi Mihai,

If the filter is set to use non-HTML syntax with {mlang xx}..{mlang} constructions you can insert these constructions with WYSIWYG text editor. But you must be careful not to insert any line or paragraph breaks between these construction.

If you type in a paragraph:

{mlang en}English text{mlang}{mlang fr}Texts in French{mlang}

this will work. But if you break this in separate lines or paragraph like this:

{mlang en}English text{mlang}
{mlang fr}Text in French{mlang}

this will not work, because between ending {mlang} and {mlang fr} the editor will insert a <br> tag or a pair of </p><p> tags and this will break the syntax of the multy-lingual block.

This syntax is not tested enough. It must be observed more in which cases the filter works well and in which cases it does not work and some rules must be formulated to follow so to make the filter to work.

 

Average of ratings:Useful (2)
In reply to Germán Valero

Re: A more flexible version of multilang filte

by Vanyo Georgiev -
In reply to Vanyo Georgiev

Re: A more flexible version of multilang filte

by Germán Valero -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Vanyo,

Congratulations on your plugin approval smile

When I was translating the English strings in AMOS for the mexican spanish pack, I had some difficulty grasping the meaning of one string:

2.6 [mode_desc,filter_multilangsecond] If this is set a non HTML syntax is used {mlang en}English{mlang}{mlang bg}Bulgarian{mlang}. Othewise lang="XX" attribute of html tags is used to identify language &lt;p lang="en"&gt;English&lt;/p&gt;&lt;p lang="bg"&gt;Bulgarian&lt;/p&gt;.

 

I would dare to suggest you to consider adding a comma after "If this is set",  to make it easier for other translators to understand.

I am looking forward to using your plugin for my University site pretty soon.

In reply to Germán Valero

Re: A more flexible version of multilang filte

by Vanyo Georgiev -

Thank you German,

I have corrected the help string, but only in the git repository so far. I will replace the zip file for download next time when I will have to I make some other changes.