Hi there,
I have a plugin where an administrator can enter a language-aware string, such as:
<span class="multilang" lang="en">Hello</span><span class="multilang" lang="fr">Bonjour<span>
I've read through the https://docs.moodle.org/dev/Output_functions and my assumption is that the multilanguage stuff is being done by a filter.
I've found that the use of format_string($x) sometimes works to filter the relevant language strings when I'm displaying this value. However, sometimes it doesn't, by which, I mean that it strips all HTML out leading to bulleted lists turning into straight paragraphs and still presents the content in both languages. I have tried to use it with $options = array('escape' => false) but that has made no difference.
I've also tried format_text() which doesn't seem to process the filters (I assume this multilang stuff is being handled by a filter?) even though the documentation says that options->filter for this method defaults to true.
I'm not clear why this is the case - so is there anything I should know about this? Is there anywhere I can go to learn more?