FALSE]; return $options; } /** * {@inheritdoc} */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); $form['native_language'] = [ '#title' => $this->t('Display in native language'), '#type' => 'checkbox', '#default_value' => $this->options['native_language'], ]; } /** * {@inheritdoc} */ public function render(ResultRow $values) { $value = $this->getValue($values); $languages = $this->options['native_language'] ? \Drupal::languageManager()->getNativeLanguages() : \Drupal::languageManager()->getLanguages(); return isset($languages[$value]) ? $languages[$value]->getName() : ''; } }