language_process_language_select($element)
Processes a language select list form element.
Parameters
array $element: The form element to process.
Return value
array $element The processed form element.
File
- core/modules/language/language.module, line 152
- Add language handling functionality to Drupal.
Code
function language_process_language_select($element) { // Don't set the options if another module (translation for example) already // set the options. if (!isset($element['#options'])) { $element['#options'] = array(); foreach (\Drupal::languageManager()->getLanguages($element['#languages']) as $langcode => $language) { $element['#options'][$langcode] = $language->isLocked() ? t('- @name -', array('@name' => $language->getName())) : $language->getName(); } } return $element; }
Please login to continue.