-
Improvement
-
Resolution: Fixed
-
Minor
-
2.0
-
None
-
MOODLE_20_STABLE
-
MOODLE_20_STABLE
-
MDL-27073_multilang-custommenu -
When we are using the new "custommenuitems", we should have the possibility to create the menu for different languages, since we are able to localize everything else.
1) We could use a notation like this:
[en-US:Moodle community;pt-PT:Comunidade Moodle]|http://moodle.org
-[en-US:Moodle free support;pt-PT:Suporte gratuito do Moodle]|http://moodle.org/support
-[en-US:Moodle development;pt-PT:Desenvolvimento do Moodle]|http://moodle.org/development
by adding in /lib/outputcomponents.php (around line 2386) something like:
if (!array_key_exists(0, $bits) || empty($bits[0]))
else {
$bits[0] = ltrim($bits[0],'-');
+ $languages = explode(';', $bits[0]); // pt:nome;en:name|url|title|sort
+ if (array_key_exists(0, $languages)) {
+ foreach ($languages as $language)
+ }
2) or using the multilang plugin by adding in /lib/outputcomponents.php (around line 2372) something like:
public static function convert_text_to_menu_nodes($text) {
+ $text = format_text($text, $format=FORMAT_MARKDOWN, $options=NULL, $courseid=NULL);
With this line we could use the following syntax to the custommenu text:
<span lang="en" class="multilang">
Home|http://moodleurl
-blah|blahlink
</span>
<span lang="pt" class="multilang">
Início|http://moodleurl
-blah|blahlink
</span>