function Language::getButtons

Same name in other branches
  1. 8.9.x core/modules/ckeditor/src/Plugin/CKEditorPlugin/Language.php \Drupal\ckeditor\Plugin\CKEditorPlugin\Language::getButtons()

Overrides CKEditorPluginButtonsInterface::getButtons

File

core/modules/ckeditor/src/Plugin/CKEditorPlugin/Language.php, line 83

Class

Language
Defines the "language" plugin.

Namespace

Drupal\ckeditor\Plugin\CKEditorPlugin

Code

public function getButtons() {
    $label = $this->t('Language');
    return [
        'Language' => [
            'label' => $label,
            'image_alternative' => [
                '#type' => 'inline_template',
                '#template' => '<a href="#" class="cke-icon-only" role="button" title="{{ label }}" aria-label="{{ label }}"><span class="cke_button_icon cke_button__language_icon">{{ label }}</span></a>',
                '#context' => [
                    'label' => $label,
                ],
            ],
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.