This means that the plugin might not be compatible with WPML and you need to create a different chatbot for each language which can be achieved with custom code.
However, I will try to point you in the right direction. You can use the wpml_current_language hook with "if/elseif" statement as in the below example to execute different codes depending on the language:
function custom_head_scripts_based_on_language() {
// Get the current language using WPML's wpml_current_language function
$current_language = apply_filters( 'wpml_current_language', NULL );
// Check the current language and output language-specific script tags accordingly
if ( $current_language === 'en' ) {
echo 'The English chatbot script code goes here';
} elseif ( $current_language === 'es' ) {
echo 'The Spanish chatbot script code goes here';
}
// Add more languages and their script URLs using additional else if statements as needed
}
add_action( 'wp_head', 'custom_head_scripts_based_on_language' );
Note: The possible solution provided is to be used just as an informational one. Please remember that custom coding is out of the scope of our support, so we can't create, debug or modify code for you and it's your responsibility to maintain it. We hope the one we used as an example could point you in the right direction.