multilang html-block titleI

multilang html-block titleI

by Daniel Schimrik -
Number of replies: 7

Hello,

I am working currently on a multilanguage moodlesite with 4 languages. The content and title of content is translated as expected.

If inserting an HTML-block, I can insert multilang content, but no multilang title of this block. The language settings in the title are ignored by Moodle and it shows all titles at once.

Is there any way to also translate the title of HTML-blocks? (I am running Moodle 1.9)


Regards, Daniel

Average of ratings: -
In reply to Daniel Schimrik

Re: multilang html-block titleI

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers
I have not tested this, but in the absence of other suggestions, how about the following:
  1. open "blocks/moodleblock.class.php" with a text editor
  2. locate the following line (around line 356 in the "_title_html" function):
    $title .= '<h2>'.$this->title.'</h2>';
  3. change the above line to:
    $title .= '<h2>'.filter_text($this->title).'</h2>';
  4. saved the modified file
hope that helps
Gordon
In reply to Gordon Bateson

Re: multilang html-block titleI

by Robert Brenstein -
If this works, it should be posted into the bugtracker for possible inclusion in Moodle distro.
Average of ratings: Useful (1)
In reply to Gordon Bateson

Re: multilang html-block titleI

by Daniel Schimrik -
Hello Gordon,

I tried your solution and it works perfectly! So I posted a message to the bug-tracker about this issue.

@Anthony: I had already activated filter anything in the filter section of Moodle

Regards, Daniel
In reply to Daniel Schimrik

Re: multilang html-block titleI

by Nicolas Martignoni -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Could you point us to the issue number?
In reply to Daniel Schimrik

Re: multilang html-block titleI

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
Daniel - Before modifying the code, try going to the Administration Block and under filter settings there should be an option to filter all strings. Turn that on and see if it does the trick. Peace - Anthony