function LocaleLanguages::getTranslatableLanguages
Same name and namespace in other branches
- main core/modules/locale/src/LocaleLanguages.php \Drupal\locale\LocaleLanguages::getTranslatableLanguages()
Returns list of translatable languages.
Return value
array Array of installed languages keyed by language name. English is omitted unless it is marked as translatable.
File
-
core/
modules/ locale/ src/ LocaleLanguages.php, line 25
Class
- LocaleLanguages
- Manages which languages are translatable and checks a specific language.
Namespace
Drupal\localeCode
public function getTranslatableLanguages() : array {
$languages = $this->languageManager
->getLanguages();
if (!$this->isTranslatable('en')) {
unset($languages['en']);
}
return $languages;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.