Commit 64c9579c authored by Jordan Karlov's avatar Jordan Karlov Committed by Jordan Karlov
Browse files

Issue #3269929 by JordiK, larisse: Make custom On Off labels translatable

parent 54e16a6e
Loading
Loading
Loading
Loading
+2 −2
Changes for src/Plugin/Field/FieldWidget/BootstrapToggle.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -254,10 +254,10 @@ class BootstrapToggle extends WidgetBase {

    // Set data-on and data-off attributes in a button.
    if ($this->getSetting('bootstraptoggle_data_on')) {
      $element['#attributes']['data-on'] = $this->getSetting('bootstraptoggle_data_on');
      $element['#attributes']['data-on'] = $this->t(':label', [':label' => $this->t($this->getSetting('bootstraptoggle_data_on'))]);
    }
    if ($this->getSetting('bootstraptoggle_data_off')) {
      $element['#attributes']['data-off'] = $this->getSetting('bootstraptoggle_data_off');
      $element['#attributes']['data-off'] = $this->t(':label', [':label' => $this->t($this->getSetting('bootstraptoggle_data_off'))]);
    }

    // Set data-size attribute of button.