Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
I can't translate the links of the social icons Elementor widgets.

Solution:
Please add this code to the functions.php file of your theme:

add_action('init', function (){
        add_filter( 'wpml_elementor_widgets_to_translate', 'socialwidgetelementor' );
});
 
 
function socialwidgetelementor($widgets)
{
        $widgets['social-icons'] = array(
                'conditions' => array('widgetType' => 'social-icons'),
                'fields' => array(),
                'integration-class' => array(
                        'my_icons'
                         
                )
        );
 
        return $widgets;
}
 
class my_icons extends WPML_Elementor_Module_With_Items
{
 
        public function get_items_field()
        {
                return 'social_icon_list';
        }
 
        public function get_fields()
        {
                return array(
                        'link' => array( 'url' ),
                );
        }
 
        protected function get_title($field)
        {
                switch ($field) {
                        case 'url':
                                return __( 'Link', 'elementor' );
                        
                        default:
                                return '';
                }
        }
 
        protected function get_editor_type($field)
        {
                switch ($field) {
                        case 'url':
                                return 'LINK';
 
                        default:
                                return '';
                }
        }
}

and add again the Social Icons widget to the page.

Relevant Documentation:
https://wpml.org/documentation/plugins-compatibility/elementor/how-to-add-wpml-support-to-custom-elementor-widgets/#multiple-occurrences-of-the-same-field

0% of people find this useful.

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.

This topic contains 10 replies, has 5 voices.

Last updated by reneB-22 4 years, 2 months ago.

Assisted by: Radu.

Author Posts
December 1, 2020 at 9:43 am #7568185

reneB-22

The Social Icon widget link is not available in ATE

December 3, 2020 at 5:53 pm #7589195

Marcos Vinicios Barreto

Hello,

Thank you for contacting our support service. I tried several methods of making the url/links field content to be available for translation, unfortunately the issue persists, this is why I forward this ticket to our compatibility team for a more detailed look.

I will update you here as soon as we have some details regarding it. Thank you for your patience and understanding, have a nice day.

December 9, 2020 at 1:29 pm #7625425

Otto
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Argentina/Buenos_Aires (GMT-03:00)

Hello,

Please apologize for the delay.

Can you please try this:
In WPML > Settings > Custom XML add this

<wpml-config>
    <elementor-widgets>
        <widget name="social-icons">
            <conditions>
                <condition key="widgetType">social-icons</condition>
            </conditions>
            <fields-in-item items_of="social_icon_list">
                <field type="Social Icon: Link" editor_type="LINK">link>url</field>
            </fields-in-item>
        </widget>
    </elementor-widgets>
</wpml-config>

Let us know how it goes, please.

Kind regards,

Otto

December 10, 2020 at 11:10 am #7633921

reneB-22

Hi Otto,

Did not work. The url was still not available for translation in ATE.

December 10, 2020 at 11:10 am #7633927

reneB-22

Hi Otto,

Did not work. The url was still not available for translation in ATE.

December 10, 2020 at 2:53 pm #7636103

Ahmed Mohammed
Supporter

Timezone: Africa/Cairo (GMT+02:00)

Can you please edit the page in the original language (maybe add a dummy text) and then check if the URL appears in the translation editor?

December 10, 2020 at 4:20 pm #7636961

reneB-22

That is what I always do. To force WPML to go into the ATE, I change the title and then update, then update the translation.

December 11, 2020 at 8:50 am #7642297

Radu

Hey Rene,

Is there any chance that you could give me access to the dashboard area of your website so I can have a closer look at this widget, please?
I checked the sandbox website here:
hidden link

but I no longer see the social widget on it. In this case, I would like to have a look at your website, copy the same element on the sandbox, and see what's going on.

The next reply is set to be private so you can safely send me the credentials.

Thanks,
Radu

December 11, 2020 at 11:53 am #7644217

reneB-22

Sorry, username should be Wpml
🙂

December 13, 2020 at 11:37 pm #7656317

Radu

Hey Rene,

Thank you for updating me about the username. I was able to access the dashboard area, add the code from here to the functions.php file of the child theme:
https://wpml.org/forums/topic/social-icon-links-dont-appear-in-translations/#post-6529123

and translate the social links through WPML → String translation area. Can you check now the links on the Nederlands language, please?

Also, some changes might not be visible due to the SG caching plugin. I know that it's a very powerful plugin, but it might be a good idea to keep it deactivated while you still work on the website. I had to clear the cache and refresh the page a couple of times in order to see the links changed.

Thanks,
Radu