moodle/filter/multilang
Eloy Lafuente (stronk7) 115cc0214f MDL-68973 versions: bump all versions and requires near release
version = 2020061500 release version
requires= 2020060900 current rc1 (week7roll1) version
2020-06-09 16:23:09 +02:00
..
classes/privacy MDL-61896 filter: Implement privacy API for all filters 2018-04-08 15:55:37 +08:00
lang/en MDL-61896 filter: Implement privacy API for all filters 2018-04-08 15:55:37 +08:00
tests MDL-55197 filter_multilang: handle 'en' as parent lang better 2019-05-22 11:14:17 +01:00
filter.php MDL-55197 filter_multilang: handle 'en' as parent lang better 2019-05-22 11:14:17 +01:00
README.txt
settings.php MDL-42243 fix filter settings regression and support standard settings.php 2013-10-12 13:38:34 +02:00
version.php MDL-68973 versions: bump all versions and requires near release 2020-06-09 16:23:09 +02:00

To Install it:
    - Enable if from "Administration/Filters".

To Use it:
    - Create your contents in multiple languages.
    - Enclose every language content between:
        <span lang="XX" class="multilang">your_content_here</span><span lang="YY" class="multilang">your_content_other_lang</span>
    - Test it (by changing your language).

How it works:
    - look 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, print the first language found in the text.
    - text out of "lang blocks" will be showed always.

Definition of "lang block":
    Is a collection of lang tags separated only by whitespace chars (space,
    tab, linefeed or return chars).

One example in action:
    - This text:
        <span lang="en" class="multilang">Hello!</span><span lang="es" class="multilang">Hola!</span>
        This text is common for every language because it's out from any lang block.
        <span lang="en" class="multilang">Bye!</span><span lang="it" class="multilang">Ciao!</span>

    - Will print, if current language is English:
        Hello!
        This text is common for every language because it's out from any lang block.
        Bye!

    - And, in Spanish, it will print:
        Hola!
        This text is common for every language because it's out from any lang block.
        Bye!


Ciao, Eloy :-)
stronk7@moodle.org
2005-11-16

Syntax was changed in 1.8, the conversion of existing text is done from admin/multilangupgrade.php
Ciao, skodak :-)
2006-12-11