public function LingotekConfigurationService::getEnabledLanguages in Lingotek Translation 4.0.x
Same name and namespace in other branches
- 3.1.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getEnabledLanguages()
- 3.2.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getEnabledLanguages()
- 3.3.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getEnabledLanguages()
- 3.4.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getEnabledLanguages()
- 3.5.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getEnabledLanguages()
- 3.6.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getEnabledLanguages()
- 3.7.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getEnabledLanguages()
- 3.8.x src/LingotekConfigurationService.php \Drupal\lingotek\LingotekConfigurationService::getEnabledLanguages()
Returns all the languages that are Lingotek enabled.
Return value
\Drupal\language\ConfigurableLanguageInterface[] The languages.
Overrides LingotekConfigurationServiceInterface::getEnabledLanguages
File
- src/
LingotekConfigurationService.php, line 452
Class
- LingotekConfigurationService
- Service for managing lingotek configuration.
Namespace
Drupal\lingotekCode
public function getEnabledLanguages() {
$languages = \Drupal::languageManager()
->getLanguages();
// Filter the disabled languages.
$languages = array_filter($languages, function (LanguageInterface $language) {
$configLanguage = ConfigurableLanguage::load($language
->getId());
return $this
->isLanguageEnabled($configLanguage);
});
return $languages;
}