I have created a composite element where I added a custom textarea field in the element settings.

I have added that element in a webform, filled that textarea and saved the webform.

Now I want to translate the webform, But when I go the webform translations, I am unable to translate the value of that text area.

Is there any way to translate the value of that text area?

 * Provides a booking element.
 * @WebformElement(
 *   id = "my_element",
 *   label = @Translation("My element"),
 *   category = @Translation("Composite elements"),
 *   multiline = TRUE,
 *   composite = TRUE,
 *   states_wrapper = TRUE,
 * )
class Myelement extends WebformCompositeBase {
  public function form(array $form, FormStateInterface $form_state): array {
    $form = parent::form($form, $form_state);

    $form['element']['booking_email'] = [
      '#type' => 'textarea',
      '#title' => $this->t('some content'),
      '#weight' => '0',

    return $form;

Here is the backend of the element settings. enter image description here

And here is the webform translation interface. I can't see my textarea field so that I can translate its content. I only see the composite element key and title. enter image description here

1 Answer 1


You need to create a schema config file to make them translatable.

I have done it like this by creating my_module.plugin.handler.schema.yml file in my my_module/config/schema directory.

  type: mapping
  label: Booking email
      label: 'Something'
      type: text

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.