• Hello
    I cannot get transposh to translate data retrieve from ajax. The ajax works well but the content is not translate.
    Can you help me? What i am missing?

    Here is my example with accessing the page in french for example

    The transposh.php on_init()
    if (isset($_GET[‘action’]) && $_GET[‘action’] == ‘essairor’) {
    $this->target_language = transposh_utils::get_language_from_url($_SERVER[‘HTTP_REFERER’], $this->home_url);
    $this->attempt_json = true;
    }

    the html
    <button id=”ess”>ee</button>

    The javascript
    jQuery(document).ready(function($) {
    $(‘#ess’).on(‘click’,function(e) {
    e.preventDefault();
    jQuery.ajax({
    url :ajaxurl,
    data: {
    ‘action’:’essairor’
    },
    success: function( data ) {
    alert( data);
    }
    )};
    )};

    The server side php
    add_action( ‘wp_ajax_essairor’, ‘essairor’ );
    add_action(‘wp_ajax_nopriv_essairor’, ‘essairor’);
    function essairor() {
    echo json_encode(“good bye”);
    }

Viewing 1 replies (of 1 total)
  • If you download a lower version 0.9.9.1 it will work.
    I turned to the creators of the plugin, and they said it could not be …
    If you want the test version, I can send you.

Viewing 1 replies (of 1 total)
  • The topic ‘Use transposh in Ajax event’ is closed to new replies.