Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Europe/Kyiv (GMT+03:00)

This topic contains 19 replies, has 3 voices.

Last updated by Andrey 3 days, 11 hours ago.

Assisted by: Andrey.

Author Posts
September 26, 2024 at 7:56 am #16223391

gianlucaP-16

Hi Andrey

Thank you for checking. Unfortunately that does not work for us, as its not only the Liquid button but also other Liquid elements, for example as seen in this page hidden link

Is there any way to maybe register those kind of elements and make them translatable?

September 26, 2024 at 11:37 am #16224779

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Yes, it is possible. We have documentation on how to register custom page builder widgets for translation.

You need to follow this article:
https://wpml.org/documentation/support/language-configuration-files/how-to-register-page-builder-widgets-for-translation/

I noticed that your parent theme already has a wpml-config.xml file. The code registers those themes' widgets for translation. You or the theme author need to adjust the code to add the links to the translation.

For example, I have found the following code for the button:

		<widget name="ld_button">
			<conditions>
				<condition key="widgetType">ld_button</condition>
			</conditions>
			<fields>
				<field type="Liquid Button Text" editor_type="LINE">title</field>
			</fields>
		</widget>

You have to add an additional field that adds the button link to the translation. Here's an example from the article above:

<field type="Heading: Link URL" editor_type="LINK">link>url</field> 

I hope this helps.

September 26, 2024 at 11:51 am #16224809

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

I went ahead and used the Multilingual Tools plugin to generate an XML config for a few custom Elementor widgets (Liquid button and Liquid content Box from the last page you mentioned).

What have I done?

1. Installed Multilingual Tools plugin on your test site.
2. Followed this article: https://wpml.org/documentation/support/multilingual-tools/registering-custom-elementor-widgets-for-translation/#using-wpml-config-generator-for-elementor
3. Took already existing content for those widgets from a wpml-config.xml file of your theme. Which looks like:

    <widget name="ld_button">
      <conditions>
        <condition key="widgetType">ld_button</condition>
      </conditions>
      <fields>
        <field type="Liquid Button Text" editor_type="LINE">title</field>
      </fields>
    </widget>
    <widget name="ld_content_box">
      <conditions>
        <condition key="widgetType">ld_content_box</condition>
      </conditions>
      <fields>
        <field type="Liquid Box: Title" editor_type="LINE">title</field>
        <field type="Liquid Box: Subtitle" editor_type="LINE">subtitle</field>
        <field type="Liquid Box: Label" editor_type="LINE">label</field>
        <field type="Liquid Box: Content" editor_type="LINE">content2</field>
      </fields>
    </widget> 

4. Checked the code generated in Step 2 for widgets and took only the fields for the button link.

<field type="Liquid Button Link" editor_type="LINK">link>url</field>

and

        <field type="Liquid Box: Button Link" editor_type="LINK">ib_link>url</field>
        <field type="Liquid Box: Image Link" editor_type="LINK">img_link>url</field>

5. Added to the existing code and further added the new config for two widgets to WPML → Settings → Custom XML Configuration.

<wpml-config>
  <elementor-widgets>
    <widget name="ld_button">
      <conditions>
        <condition key="widgetType">ld_button</condition>
      </conditions>
      <fields>
        <field type="Liquid Button Text" editor_type="LINE">title</field>
        <field type="Liquid Button Link" editor_type="LINK">link>url</field>
      </fields>
    </widget>
    <widget name="ld_content_box">
      <conditions>
        <condition key="widgetType">ld_content_box</condition>
      </conditions>
      <fields>
        <field type="Liquid Box: Title" editor_type="LINE">title</field>
        <field type="Liquid Box: Subtitle" editor_type="LINE">subtitle</field>
        <field type="Liquid Box: Label" editor_type="LINE">label</field>
        <field type="Liquid Box: Content" editor_type="LINE">content2</field>
        <field type="Liquid Box: Button Link" editor_type="LINK">ib_link>url</field>
        <field type="Liquid Box: Image Link" editor_type="LINK">img_link>url</field>
      </fields>
    </widget>
  </elementor-widgets>
</wpml-config>

6. Updated the original pages with the links (Räume and FAQ). I completed the translations, and the links are now converted.

If there are some more widgets, you need to handle them on your own.

Screenshot 2024-09-26 at 14.49.33.png
Screenshot 2024-09-26 at 14.49.07.png
September 26, 2024 at 1:59 pm #16225696

gianlucaP-16

Hi Andrey

Thank you for your work. So that means, I should now be able to see these kind of buttons in the advanced translator, right? Because currently, I do not see where I can translate the link.

s1.png
September 26, 2024 at 2:12 pm #16225788

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

No, it should be converted automatically when you complete the translation and if a link translation exists. This is because I indicated editor_type="LINK" in the config.