/** * Translates and return a title for a menu item. * * This method will attempt to find a "menu.key_item" through the translator * component. If no translation is found for this item, it will attempt to * transform the item $key string to a title readable format. * * @param $key * @return string */ protected function translateTitle($key) { $translation = $this->lang->get('menu.' . $key); if ($translation != 'menu.' . $key) { return $translation; } return String::title($key); }