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.
Kind regards,
Mohamed
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.