You are here

function webform_webform_options_translations_alter in Webform 6.x

Same name and namespace in other branches
  1. 8.5 includes/webform.options.inc \webform_webform_options_translations_alter()

Implements hook_webform_options_WEBFORM_OPTIONS_ID_alter() for translations options.

File

includes/webform.options.inc, line 80
Options alter hooks.

Code

function webform_webform_options_translations_alter(array &$options, array $element = []) {
  if (empty($options)) {
    $languages = \Drupal::languageManager()
      ->getLanguages();
    $options = [];
    foreach ($languages as $language) {
      $options[$language
        ->getId()] = $language
        ->getName();
    }
  }
}