WPML

Overview of the Issue

If you are using the Elementor loop template (opens in a new tab) feature, buttons aren’t translated on the front-end even if they are available for translation in the Advanced Translation Editor.

Workaround

This issue is fixed in WPML 4.6.4. Updating solves it on your site, so you only need this workaround if you can’t update yet.

Please be sure of making a full backup of your site before proceeding.

  1. Open the /wp-content/plugins/sitepress-multilingual-cms/addons/wpml-page-builders/classes/Integrations/Elementor/class-wpml-elementor-translate-ids.php file.
  2. Look for line 108.
  3. Replace the WPML_Elementor_Translate_IDs::translate_global_widget_ids() method:
    PHP
    public function translate_global_widget_ids( $data_array, $post_id ) {
    		foreach ( $data_array as &$data ) {
    			if ( isset( $data['elType'] ) && 'widget' === $data['elType'] ) {
    				if ( 'global' === $data['widgetType'] ) {
    					$data['templateID'] = $this->translate_id( $data['templateID'] );
    				} elseif ( 'template' === $data['widgetType'] ) {
    					$data['settings']['template_id'] = $this->translate_id( $data['settings']['template_id'] );
    				}
    			}
    			$data['elements'] = $this->translate_global_widget_ids( $data['elements'], $post_id );
    		}
    
    		return $data_array;
    	}

    With:

    PHP
    public function translate_global_widget_ids( $data_array, $post_id ) {
            foreach ( $data_array as &$data ) {
                if ( isset( $data['elType'] ) && 'widget' === $data['elType'] ) {
                    if ( 'global' === $data['widgetType'] ) {
                        $data['templateID'] = $this->translate_id( $data['templateID'] );
                    } elseif ( 'template' === $data['widgetType'] || 'loop-grid' === $data['widgetType'] || 'loop-carousel' === $data['widgetType']) {
                        $data['settings']['template_id'] = $this->translate_id( $data['settings']['template_id'] );
                    } 
                }
                $data['elements'] = $this->translate_global_widget_ids( $data['elements'], $post_id );
            }
    
            return $data_array;
        }
  4. Translate the Elementor loop template in WPMLTranslation Management.

All known issues

Still Seeing This Issue?

If updating doesn’t fix it, ask a support question and we’ll look into it with you.