You are here

protected function TranslationTargetLanguageFilter::buildLanguageOptions in Translation Views 8

Provide options for langcode dropdown.

Return value

array Available options based on configurable languages.

1 call to TranslationTargetLanguageFilter::buildLanguageOptions()
TranslationTargetLanguageFilter::valueForm in src/Plugin/views/filter/TranslationTargetLanguageFilter.php
Options form subform for setting options.

File

src/Plugin/views/filter/TranslationTargetLanguageFilter.php, line 219

Class

TranslationTargetLanguageFilter
Provides filtering by translation target language.

Namespace

Drupal\translation_views\Plugin\views\filter

Code

protected function buildLanguageOptions() {
  $options = [];
  if ($this->translatorsContent && $this->options['limit']) {
    $translators_languages = $this->translatorSkills
      ->getTranslationSkills();

    // Handle column options.
    foreach ($this->options['column'] as $name => $column) {
      if (!empty($column)) {
        foreach ($translators_languages as $langs) {
          $this
            ->processColumnOption($langs, $name, $options);
        }
      }
    }
  }
  else {
    $options = $this
      ->listLanguages(LanguageInterface::STATE_CONFIGURABLE);
  }
  return $options;
}