I have the following code in my custom block:
public function blockForm($form, FormStateInterface $form_state) { $form = parent::blockForm($form, $form_state); $config = $this->getConfiguration(); $form['headline'] = array( '#type' => 'textfield', '#title' => $this->t('Block headline'), '#default_value' => isset($config['headline']) ? $config['headline'] : NULL, '#required' => TRUE, ); return $form; }
and:
public function blockSubmit($form, FormStateInterface $form_state) { $this->setConfigurationValue('headline', $form_state->getValue('headline')); }
The configuration is saved correctly, but only for English language.
The block translation doesn’t show my variable (headline) in the translatable configuration.
What am I doing wrong?
Thanks
Sponsored by SupremePR