Sorry about this, I wasn't able to pinpoint the source of the problem on your site, so I took a copy of the theme and the Machic core plugin to test on my own local site, where the link is also proving difficult to translate.
Let me speak to my colleagues and see if I can get some specific direction.
I'm pleased to say we have a solution. We have identified problems handling link translation for Elementor custom widgets which have repeating elements (in this case the slider).
Although we should in future be able to handle it with conventional custom XML (such as that which I already provided to you), in this case we need to add some code to your child theme's functions.php.
First, you need to go to WPML > Settings > Custom XML Configuration and remove just the part of the custom XML which registers the machic home slider widget, i.e. this part:
You can leave the other widget declarations in place.
Then add this code to your functions.php:
/**
* Custom registration of machic home slider widget for translation
*/
add_action('init', function () {
add_filter('wpml_elementor_widgets_to_translate', function ($widgets) {
$widgets['machic-home-slider'] = [
'conditions' => ['widgetType' => 'machic-home-slider'],
'fields' => [],
'integration-class' => 'machicHomeSlider'
];
return $widgets;
});
/**
* Class to translate the Machic machic-home-slider widget.
*
* @see wpmltriage-1291
*/
class machicHomeSlider extends WPML_Elementor_Module_With_Items {
/**
* @return string
*/
public function get_items_field() {
return 'slider_items';
}
/**
* @return array
*/
public function get_fields() {
return [
'slider_title',
'slider_subtitle',
'slider_second_subtitle',
'slider_offer',
'slider_btn_title',
'slider_btn_link' => [
'url'
]
];
}
/**
* @param string $field
*
* @return string
*/
protected function get_title($field) {
switch ($field) {
case 'slider_title':
return esc_html__('Slider Title', 'machic');
case 'slider_subtitle':
return esc_html__('Slider Subtitle', 'machic');
case 'slider_second_subtitle':
return esc_html__('Slider Second Subtitle', 'machic');
case 'slider_offer':
return esc_html__('Slider Offer', 'machic');
case 'slider_btn_title':
return esc_html__('Slider Button Title', 'machic');
case 'url':
return esc_html__('Slider Button: Link', 'machic');
default:
return '';
}
}
/**
* @param string $field
*
* @return string
*/
protected function get_editor_type($field) {
switch ($field) {
case 'slider_title':
return 'LINE';
case 'slider_subtitle':
return 'LINE';
case 'slider_second_subtitle':
return 'LINE';
case 'slider_offer':
return 'LINE';
case 'slider_btn_title':
return 'LINE';
case 'url':
return 'LINK';
default:
return '';
}
}
}
});
You then need to make a trivial edit to the page, update it, and then translate it again.
You won't see internal links in the translation editor, as they are handled automatically, but if you have any external links you can search for them by searching for "http".
georgiosS-18 confirmed that the issue was resolved on 2024-03-01 12:45:39.
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.