transposh

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 years, 5 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #30297
    treks84
    treks84
    Participant

    is there a way to solve my problem with transposh, search result are allways in the default language.

    #30299
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Well, unfortunately transposh is not supported officially, but I recall we were able to suggest a custom code in a previous ticket, that worked with some results.

    Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

    add_action('asl_layout_in_form', 'aslp_in_form_add_param', 10);
    add_action('asp_layout_in_form', 'aslp_in_form_add_param', 10);
    function aslp_in_form_add_param() {
    	echo '<input type=hidden name="trp_lang" value="'.transposh_get_current_language().'">';
    }
    
    add_filter('asl_results', 'aslp_add_lang_param', 10, 1);
    add_filter('asp_results', 'aslp_add_lang_param', 10, 1);
    function aslp_add_lang_param($results) {
    	if (is_array($_POST['options']))
    		$options = $_POST['options'];
    	else
    		parse_str($_POST['options'], $options);
    	$url = get_site_url();
    	$lang_url = $url . '/' . $options['trp_lang'];
    	foreach ($results as $k=>&$r) {
    			$r->link = str_replace($url, $lang_url, $r->link);
    	}
    	return $results;
    }
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #30300
    treks84
    treks84
    Participant

    Hello,

    I had already added this code but unfortunately without results.
    on the forum there is also a notice of a change in the plugin ‘transposh’
    Do you know what has changed there. there are private replys, so I can’t read it

    I hope there is a solution.

    #30302
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I’m afraid this is no longer possible. The change in the mentions was related to something else.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.