public static function AdminHelper::getAllEnabledLanguages in Search and Replace Scanner 8
Get all enabled languages, including the current language.
1 call to AdminHelper::getAllEnabledLanguages()
- Node::replace in src/
Plugin/ Scanner/ Node.php - Performs the replace operation for the given string/expression.
File
- src/
AdminHelper.php, line 64
Class
- AdminHelper
- Shared logic for use in the mdoule.
Namespace
Drupal\scannerCode
public static function getAllEnabledLanguages() {
// Get the list of all languages.
$languages = \Drupal::languageManager()
->getLanguages();
$other_languages = [];
// Add each enabled language, aside from the current language to an array.
foreach ($languages as $field_language_code => $field_language) {
$other_languages[$field_language_code] = $field_language
->getName();
}
return $other_languages;
}