Commit 2c555c1e authored by Felip Manyer i Ballester's avatar Felip Manyer i Ballester
Browse files

Issue #3282696: Port of l10n_community: translation form

parent 394d4437
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@ td.sid a {
  }
  li.translation.no-translation .l10n-string span {
    font-style: italic;
    font-weight: normal;
    color: #666;
  }

+4 −3
Original line number Diff line number Diff line
@@ -573,7 +573,6 @@ class TranslateForm extends FormBase implements TrustedCallbackInterface {
    // Active radio box is used to pick the approved translation.
    $form['active'] = [
      '#type' => 'radio',
      // @todo transcribe.
      // #title does not support render arrays...
      '#title' => $this->render($this->renderTextarray($string->translation, $is_new ? $this->t('(empty)') : FALSE)),
      '#return_value' => $string->tid,
@@ -583,6 +582,8 @@ class TranslateForm extends FormBase implements TrustedCallbackInterface {
      // would otherwise not have permission to approve such a string.
      '#disabled' => !$may_moderate && !$is_active,
      '#attributes' => ['class' => ['selector']],
      '#label_attributes' => ['class' => ['l10n-string']],
      '#title_display' => $is_new ? 'invisible' : 'before',
    ];

    if ($string->tid) {
@@ -600,7 +601,7 @@ class TranslateForm extends FormBase implements TrustedCallbackInterface {
          '#type' => 'textarea',
          '#cols' => 60,
          '#rows' => 3,
          '#default_value' => $this->t('New translation'),
          '#default_value' => $this->t('<New translation>'),
        ]);
      }
      else {
@@ -678,7 +679,7 @@ class TranslateForm extends FormBase implements TrustedCallbackInterface {
        $element['#attributes']['class'][] = 'no-translation';
        // Fallthrough.
      default:
        if ($element['active']['#value'] !== '') {
        if (!empty($element['active']['#value'])) {
          $element['#attributes']['class'][] = 'is-active default';
        }
    }