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.
Tagged: Bug, Compatibility, Custom Work, Documentation request
This topic contains 13 replies, has 2 voices.
Last updated by Waqas Bin Hasan 1 year, 11 months ago.
Assisted by: Waqas Bin Hasan.
Author | Posts |
---|---|
July 19, 2023 at 8:25 pm #14068641 | |
Jason |
I'm trying to: Translate the links and attributes of the Elementor Social Icons widget through the ATE. I've followed: https://wpml.org/documentation/support/language-configuration-files/how-to-register-page-builder-widgets-for-translation/ I've used the Custom XML Configuation to configure wpml-config code to add translation support for Custom Attributes of Elementor Button links and Elementor Heading links, but I've been unsuccessfuly adding xml to translate icon Links URLs and Custom Attributes of the Elementor Social Icons widget. This is what I've tried. Am I missing somthing? <wpml-config> I'm using up to date WordPress, WPML, Elementor, and Elementor Pro plugins. And I've tried adding Social Icons to totally new pages and the links and custom attributes still do not show up in the ATE. |
July 20, 2023 at 11:14 am #14071653 | |
Waqas Bin Hasan WPML Supporter since 05/2014
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Hi, Thank you for contacting the support. You XML looks fine as per the structure and tags, however, can you try with removing the "conditions" part and see if it helps? Remember to make a little change in the content (page or post where it is used) and save before updating the translation in ATE. Please let me know if this helps or I'll try my best to further help you on the matter. Regards. |
July 20, 2023 at 5:20 pm #14074637 | |
Jason |
I attempted to remove all of my conditions, saved, then added a new Social Icons widget to the page with link and attributes, saved, and then went into the ATE to update translation and it's still not showing for Social Icons. Works fine for new buttons and headings. This is my full wpml-config on the Custom XML Configuation screen including the heading and button overrides: <wpml-config> <elementor-widgets> <widget name="button"> <fields> <field type="Button" editor_type="LINE">text</field> <field type="Button: Link URL" editor_type="LINK">link>url</field> <field type="Button: Custom Attributes" editor_type="LINE">link>custom_attributes</field> </fields> </widget> <widget name="heading"> <fields> <field type="Heading" editor_type="LINE">title</field> <field type="Heading: Link URL" editor_type="LINK">link>url</field> <field type="Heading: Custom Attributes" editor_type="LINE">link>custom_attributes</field> </fields> </widget> <widget name="social-icons"> <fields-in-item items_of="social_icon_list"> <field type="Social Icon: Link URL" editor_type="LINK">link>url</field> <field type="Social Icon: Custom Attributes" editor_type="LINE">link>custom_attributes</field> </fields-in-item> </widget> </elementor-widgets> </wpml-config> |
July 21, 2023 at 8:44 am #14077119 | |
Waqas Bin Hasan WPML Supporter since 05/2014
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for retrying and explaining. I checked our forums and found only one report about it and perhaps that's the related one. Looks like it requires some custom work. However, please see https://wpml.org/forums/topic/the-social-icon-widget-link-is-not-available-in-ate/ and check the big yellow box in the beginning to find a detailed solution. You may also want to check the relevant guide https://wpml.org/documentation/plugins-compatibility/elementor/how-to-add-wpml-support-to-custom-elementor-widgets/#multiple-occurrences-of-the-same-field for details. |
July 21, 2023 at 1:51 pm #14080321 | |
Jason |
I've already been through forums and tried everything. The post from https://wpml.org/forums/topic/the-social-icon-widget-link-is-not-available-in-ate/ is from 2020 and no longer works because of the updates done in WPML 4.4.4 as you can see in this post: https://wpml.org/forums/topic/translate-the-links-of-elementor-social-icons-in-header/. That post has the exact same issue that I'm having but unfortunately there is no solution posted so I don't know how they solved it... |
July 21, 2023 at 2:07 pm #14080499 | |
Jason |
Based on https://wpml.org/forums/topic/translate-the-links-of-elementor-social-icons-in-header/ having the same issue and know that it should work using https://wpml.org/documentation/support/language-configuration-files/how-to-register-page-builder-widgets-for-translation/ functionality since 4.4.4, I'm assuming that this may be a bug with fields-in-item functionality or perhaps it's specific to the social-icons widget. |
July 21, 2023 at 2:28 pm #14080577 | |
Waqas Bin Hasan WPML Supporter since 05/2014
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Can you please create a minimal setup on the following Sandbox site? hidden link It is a fresh installation with WPML plugins uploaded (not installed or active). You can upload your theme and plugins here and setup as needed. A minimal setup to reproduce the issue is necessary. Please take your time and reply when the site is ready. Once you are able to reproduce the issue, please write down detailed steps about how one can reproduce the issue on another fresh installation. See https://wpml.org/faq/how-to-reproduce-issues-and-share-them-with-wpml-support/ for details. |
July 21, 2023 at 3:46 pm #14081111 | |
Jason |
On the fresh install, I set up WPML using French, with subfolder URL format, Translate What You Choose, and Only Myself translating. I then installed and activated the Elementor Website Builder plugin. In the Elementor setup steps, I installed and activated the Hello Theme. I then went to WPML -> Settings -> Custom XML Configuration and used the following wpml-config code: <wpml-config> <elementor-widgets> <widget name="social-icons"> <fields-in-item items_of="social_icon_list"> <field type="Social Icon: Link URL" editor_type="LINK">link>url</field> <field type="Social Icon: Custom Attributes" editor_type="LINE">link>custom_attributes</field> </fields-in-item> </widget> </elementor-widgets> </wpml-config> I then created a new Page and click Edit With Elementor. I then Exit Elementor and while still editing the page with WordPress, I click on the + icon to Translate into French, with WPML Translation Editor selected. Only the page Title is available for translation. No option for the Social Icon Link URL or Custom Attributes as I had defined in the wpml-config. |
July 24, 2023 at 6:50 am #14085895 | |
Waqas Bin Hasan WPML Supporter since 05/2014
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you so much for taking the time to reproduce the issue afresh and providing detailed steps. I am working on it and 'll get back to you as soon as I've some progress. |
July 24, 2023 at 2:00 pm #14090107 | |
Waqas Bin Hasan WPML Supporter since 05/2014
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for your patience on this. I am still working and 'll update you soon on this. |
July 25, 2023 at 9:03 am #14094493 | |
Waqas Bin Hasan WPML Supporter since 05/2014
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for your patience on this. I was somehow able to achieve this by the following XML: <wpml-config> <elementor-widgets> <widget name="social-icons"> <fields-in-item items_of="social_icon_list"> <field type="Social Icon: Custom Attributes" editor_type="LINE" key_of="link">custom_attributes</field> <field type="Social Icon: Link URL" editor_type="LINK" key_of="link">url</field> </fields-in-item> </widget> </elementor-widgets> </wpml-config> This is the same as yours, but with usage of "key_of" attribute with the fields. But this has a problem, that it only takes last field into account. Means this 'll show only URLs for translation in ATE. If you change order of the fields, then it 'll only show custom attributes in ATE. I've escalated the matter to our 2nd tier for a detailed investigation. And 'll update you accordingly. On the other hand, there are a few other points to be noted regarding registering these widgets: - After you've followed the guide (https://wpml.org/documentation/support/language-configuration-files/how-to-register-page-builder-widgets-for-translation/), the _elementor_data must be revert back to its original setting (see attached). - Then edit the content in default language, save and update translation. |
July 25, 2023 at 1:42 pm #14097069 | |
Jason |
Interesting! Well for the time being, using the key_of attribute will work for my purpose because it's only the custom_attributes that I really need to translate for aria-label accessibility. But I hope that WPML 2nd tier support will be able to fully resolve the issue. Thanks for your help! |
July 25, 2023 at 1:54 pm #14097093 | |
Waqas Bin Hasan WPML Supporter since 05/2014
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Good to know and thanks for the update. I'll update you as soon as I have some information. |
July 27, 2023 at 1:07 pm #14110991 | |
Waqas Bin Hasan WPML Supporter since 05/2014
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for your patience and cooperation. Team suggests following workaround: - Remove the XML config and any code you added. add_action('init', function () { add_filter('wpml_elementor_widgets_to_translate', function ($widgets) { $widgets['social-icons'] = [ 'conditions' => ['widgetType' => 'social-icons'], 'fields' => [], 'integration-class' => 'elementorSocialIcons' ]; return $widgets; }); /** * Class to translate the Elementor social-icons widget. * * @see wpmltriage-481 */ class elementorSocialIcons extends WPML_Elementor_Module_With_Items { /** * @return string */ public function get_items_field() { return 'social_icon_list'; } /** * @return array */ public function get_fields() { return [ 'link' => [ 'url', 'custom_attributes' ] ]; } /** * @param string $field * * @return string */ protected function get_title($field) { switch ($field) { case 'url': return esc_html__('Social Icon: URL', 'elementor'); case 'custom_attributes': return esc_html__('Social Icon: Custom Attributes', 'elementor'); default: return ''; } } /** * @param string $field * * @return string */ protected function get_editor_type($field) { switch ($field) { case 'custom_attributes': return 'LINE'; case 'url': return 'LINK'; default: return ''; } } } }); I've tried this in the sandbox and it seems to work perfectly fine (see attached). |