Support » Plugin: VVAme chat » WPML Compatibility

  • Resolved elepot87

    (@elepot87)


    Hello,

    I need help. I’ve download your plugin for a site that I am building.
    It is a bilingual site…Is it possibile to translate your plugin with WPML?

    Thank you,
    Eleonora

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi, I also have the same question as we have WPML on our websites.

    Thanks for letting us know.

    Suzy

    Plugin Author Creame

    (@creapuntome)

    Sorry, currently WhatsApp me hasn’t support of WPML. It’s a good feature that we’ll include in a future version.

    But thanks to WrodPress filters and a bit of code we can make it ready for translation 😀

    Add this code to your functions.php to allow WPML translations of CTA and Message:

    
    function whatsappme_save_wpml_strings($value){
    	// Register strings for translation
    	do_action( 'wpml_register_single_string', 'WhatsApp me', 'Call to action', $value['message_text'] );
    	do_action( 'wpml_register_single_string', 'WhatsApp me', 'Message', $value['message_send'] );
    
    	return $value;
    }
    add_filter( 'pre_update_option_whatsappme', 'whatsappme_save_wpml_strings' );
    
    function whatsappme_load_wpml_strings($value){
    	// Translate strings
    	$value['message_text'] = apply_filters( 'wpml_translate_single_string', $value['message_text'], 'WhatsApp me', 'Call to action' );
    	$value['message_send'] = apply_filters( 'wpml_translate_single_string', $value['message_send'], 'WhatsApp me', 'Message' );
    
    	return $value;
    }
    add_filter( 'option_whatsappme', 'whatsappme_load_wpml_strings' );
    

    Note: I haven’t checked the code, please confirm if works 😉

    Plugin Author Creame

    (@creapuntome)

    Now, in version 2.3.0 WPML and Polylang is supported. 🎉🥳

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WPML Compatibility’ is closed to new replies.