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?
|
Andrey
Supporter
Languages:
English (English )
Russian (Русский )
Timezone:
Europe/Kyiv (GMT+02: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.
|
Andrey
Supporter
Languages:
English (English )
Russian (Русский )
Timezone:
Europe/Kyiv (GMT+02: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.
|
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.
|
Andrey
Supporter
Languages:
English (English )
Russian (Русский )
Timezone:
Europe/Kyiv (GMT+02: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.
|