MDL-40821 theme_bootstrapbase: show the current lang in the menu
authorSam Hemelryk <sam@moodle.com>
Tue, 7 Jan 2014 04:40:28 +0000 (17:40 +1300)
committerSam Hemelryk <sam@moodle.com>
Sun, 12 Jan 2014 19:16:11 +0000 (08:16 +1300)
theme/bootstrapbase/renderers/core_renderer.php

index b87d9c4..273f4ec 100644 (file)
@@ -105,7 +105,14 @@ class theme_bootstrapbase_core_renderer extends core_renderer {
         }
 
         if ($addlangmenu) {
-            $this->language = $menu->add(get_string('language'), new moodle_url('#'), get_string('language'), 10000);
+            $strlang =  get_string('language');
+            $currentlang = current_language();
+            if (isset($langs[$currentlang])) {
+                $currentlang = $langs[$currentlang];
+            } else {
+                $currentlang = $strlang;
+            }
+            $this->language = $menu->add($currentlang, new moodle_url('#'), $strlang, 10000);
             foreach ($langs as $langtype => $langname) {
                 $this->language->add($langname, new moodle_url($this->page->url, array('lang' => $langtype)), $langname);
             }