public function TranslationTargetLanguageField::render in Translation Views 8
Override parent to get langcode from exposed input, instead from ResultRow.
Overrides LanguageField::render
File
- src/
Plugin/ views/ field/ TranslationTargetLanguageField.php, line 59
Class
- TranslationTargetLanguageField
- Target Translation langcode field.
Namespace
Drupal\translation_views\Plugin\views\fieldCode
public function render(ResultRow $values) {
$target_langcode = $this
->getTargetLangcode();
$languages = $this->options['native_language'] ? $this->languageManager
->getNativeLanguages() : $this->languageManager
->getLanguages();
$build['#markup'] = $languages[$target_langcode]
->getName();
$build['#cache']['contexts'][] = 'url.query_args:' . self::$targetExposedKey;
return $build;
}