You are here

public function LanguageFormatter::settingsSummary in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/LanguageFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\LanguageFormatter::settingsSummary()
  2. 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/LanguageFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\LanguageFormatter::settingsSummary()

Returns a short summary for the current formatter settings.

If an empty result is returned, a UI can still be provided to display a settings form in case the formatter has configurable settings.

Return value

string[] A short summary of the formatter settings.

Overrides StringFormatter::settingsSummary

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/LanguageFormatter.php, line 103

Class

LanguageFormatter
Plugin implementation of the 'language' formatter.

Namespace

Drupal\Core\Field\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  if ($this
    ->getSetting('native_language')) {
    $summary[] = $this
      ->t('Displayed in native language');
  }
  return $summary;
}