You are here

public function LanguageSwitchMenuLink::getTitle in Cheeseburger Menu 5.0.x

Returns the localized title to be shown for this link.

Return value

string The title of the menu link.

Overrides MenuLinkInterface::getTitle

File

src/Plugin/Menu/LanguageSwitchMenuLink.php, line 89

Class

LanguageSwitchMenuLink
Language swithcher link - dynamically changes based on langcode.

Namespace

Drupal\cheeseburger_menu\Plugin\Menu

Code

public function getTitle() {
  $language_menu = $this->entityTypeManager
    ->getStorage('menu')
    ->load('language');
  $langcode = $this
    ->getPluginDefinition()['options']['langcode'];
  return $language_menu
    ->getThirdPartySetting('cheeseburger_menu', 'use_langcode', TRUE) ? $langcode : $this->languageManager
    ->getLanguageName($langcode);
}