2 min read 7 hrs ago

Translate or Change Chatbot Texts

Since AI Engine 3.8.1, every text the chatbot shows on its own can be translated or changed: "New Chat", "Try again", "Conversation cleared.", the upload and connection error messages, and so on (47 texts in total). The messages you set in the chatbot settings (the first message, the input placeholder, the send button text, etc.) are not concerned: you already control them there.

With a translation plugin

These texts are regular WordPress translations in the ai-engine text domain. If your site is in another language, they are already translated when a translation exists, and you can adjust them with a plugin like Loco Translate, like any other plugin string.

With the mwai_chatbot_texts filter

To change one or two texts without a translation file, use the mwai_chatbot_texts filter. It receives an array keyed by the original English text, and the value is what the chatbot displays:

add_filter( 'mwai_chatbot_texts', function( $texts ) {
  $texts['New Chat'] = 'Start over';
  $texts['Try again'] = 'Retry';
  $texts['Failed to upload image.'] = 'Sorry, this image could not be sent.';
  return $texts;
} );

Keep the keys exactly as they are in English, including the final period. A key that does not exist is simply ignored.

Empty State Hint

When a conversation is empty and the chatbot has no first message, the chatbot shows a short hint under the avatar, "Ask me anything!" by default. You can change it per chatbot in AI Engine → Chatbots → your chatbot, with the Empty State Hint parameter. Leave it empty to keep the default, which is translated automatically.