You are here

public function DisableLanguageManager::isCurrentLanguageDisabled in Disable language 8

File

src/DisableLanguageManager.php, line 130

Class

DisableLanguageManager
Class DisableLanguageManager.

Namespace

Drupal\disable_language

Code

public function isCurrentLanguageDisabled() {
  $currentLanguageDisabled = FALSE;
  $disabledLangCodes = array_keys($this
    ->getDisabledLanguages());
  if (isset($disabledLangCodes) && in_array($this->languageManager
    ->getCurrentLanguage()
    ->getId(), $disabledLangCodes)) {
    $currentLanguageDisabled = TRUE;
  }
  return $currentLanguageDisabled;
}