• Hello,

    I have a site in two languages, and I was wondering how to display the text “Howdy!!! Great to see you today! How can I help you?”, the personalized greeting “Hello! How can I help you today?”, etc.? I’m using WPML but can’t see anything for it. Do you think it’s possible with another method? Thanks.

    Pierre

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author kognetiks

    (@kognetiks)

    Hello Pierre,

    I’ll have to look at the code and see what I can do to support the greeting based on language. Is there any field or indicator that I could look at programmatically that would inform me which language to present?

    in the settings you can change the text and enter what you want but it won’t support transactions. That is why I’m interested in any language setting I might be able to exploit.

    Stephen

    Thread Starter DragoWeb

    (@dragoeco)

    Hi Stephen.

    I guess all multilingual WP sites use a plugin such as WPML, Polylang or similar. Maybe there’s a solution that works for all of them? But it won’t be easy. Apart from the HTML LANG tag, I can’t see any other way to dissociate the language used by the page. Personally, I had to add a filter to add this as a class in the body (add_filter > body_class). Alternatively, with WPML I can manage multilingual display via a function containing the following:

    if ( ICL_LANGUAGE_CODE === 'en' ) {
        echo = 'English text';
    } else {
        echo = 'Other language goes here';
    }

    One approach would be to offer a drop-down list with predefined messages? In that case, po/mo files would suffice to take care of the translation (i18n). But I imagine some users would like a personalized message. Maybe leave the choice to a switch? Either a predefined and translatable list, or a personalized text.

    Another option I’ve tried without success is to simply write a shortcode in the child theme’s functions.php to display the message according to the language displayed, but shortcode reading isn’t active in the text fields. But I imagine this solution is a little too technical for most users.

    I don’t know, there are probably other (simpler?) solutions, but I don’t see it tbh.

    Pierre

    Thread Starter DragoWeb

    (@dragoeco)

    Another solution might be to include a language parameter in the shortcode? I don’t know if this is possible, but GPT could then take care of the translation automatically? Each chatbot could then be displayed in a different language. Ex. [chatbot lang=”french”]. Alternatively, directly indicate the message in the shortcode [chatbot greetings=”Bonjour !”]… I’m just thinking :p

    Thread Starter DragoWeb

    (@dragoeco)

    Hi Stephen, I guess you have a lot of work to do, but have you found a solution for multilnguage or WPML yet?

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.