moodle/filter/multilang
David Mudrak dcfffe3072 MDL-24531 Extend filter manager API so that options can be passed to the filters
The only option passed at the moment is the original format in which the
user inserted the text. Other options can be added later if/when needed.
2010-10-07 08:57:20 +00:00
..
lang/en MDL-15252 Re-committing all English strings exported from AMOS 2010-04-10 14:01:45 +00:00
filter.php MDL-24531 Extend filter manager API so that options can be passed to the filters 2010-10-07 08:57:20 +00:00
filtersettings.php MDL-23234 finally standardised use of settings.php across all plugins - the only partial exceptions now are report and local plugins 2010-07-13 13:56:55 +00:00
README.txt MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup 2009-11-01 12:51:40 +00: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