-
Task
-
Resolution: Inactive
-
Minor
-
None
-
2.8.10, 2.9.4, 3.0.2
-
None
-
1.0
-
MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
-
master
This filter is a greatly simplified multi-language filter. It uses very simple non-HTML tags to mark multi-language blocks. Namely
{mlang XX}{mlang} pairs, where XX is the ISO6391 two letter code for the language (i.e., en, es, fr, eu, etc.)It uses the same tags as the filter_multilangsecond plugin (to be compatible with it), but there is one difference between them. This filter allows standalone {mlang} tags that don't require adjoining alternative language tags. This makes the filter more flexible at the cost of potentially producing empty sets of <p></p> tags.
How it works:
- it looks for "lang blocks" in the code.
- for each "lang block":
- if there are texts in the currently active language, print them.
- else, if there exists texts in the current parent language, print them.
- else, don't print any text inside the lang block
- text outside of "lang blocks" will always be shown.
Definition of "lang block":
Any text (including spaces, tabs, linefeeds or return characters) placed between '{mlang XX}
' and '
{mlang}' tags.One example in action:
- This text:
{mlang en}Hello!{mlang} {mlang es}
¡Hola!
{mlang}This text is common for every language because it's outside of
any lang block.
{mlang en}Bye!{mlang} {mlang it}
Ciao!
{mlang}- Will print, if current language is English:
Hello!
This text is common for every language because it's outside of
any lang block.
Bye!
- In Spanish, it will print:
¡Hola!
This text is common for every language because it's outside of
any lang block.
Notice the final 'Bye!' / 'Ciao!' is not printed.
- In Italian, it will print:
This text is common for every language because it's out from
any lang block. Ciao!
Notice the leading 'Hello!' / '¡Hola!' is not printed