Plugin now works with GTranslate

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Plugin now works with GTranslate

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

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #29800
    timburkart
    timburkart
    Participant

    Hi!

    I have been working with the folks at gtranslate and they made some adjustments to one of your js files. I am attaching the changed version to this ticket. My question is can you possibly incorporate these changes into your code base?

    Thank you!

    Attachments:
    You must be logged in to view attached files.
    #29807
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Thank you very much. I checked the source, but I don’t think I can incorporate that change – as it would break the redirection permalinks for every site where Gtranslate is not present. In cases where gtranslate is present, then I am not sure if the permalink is always used as in your case like: siteurl.com/language/ – it might be something else for different configurations(?), I’m not sure.

    I can however add hooks/events to the upcoming release, to have access to the redirection URL on the fly. That allows changing it via a custom code placed into the functions.php file in your child theme directory.

    After the next plugin release is ready (4.20, it should be 2-4 weeks), please place this code 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('wp_footer', 'asp_custom_js_hook');
    function asp_custom_js_hook() {
    	?>
    	<script>
    	wp.hooks.addFilter('asp_redirect_url', 'asp', function(url){
    		return url.replace(
    			"gmoresearch.org/", 
    			"gmoresearch.org/" + (document.querySelector("html").lang.indexOf("en") > -1 ? "" : document.querySelector("html").lang
    		));
    	}, 10);
    	</script>
    	<?php
    }

    That will permanently fix the issue in your case.

    Best,
    Ernest Marcinko

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


    #30820
    timburkart
    timburkart
    Participant

    Hi Ernest,

    Could you please confirm that you implemented this functionality in the 4.20 release?

    Thank you!

    Tim Burkart

    #30833
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Tim,

    Yes, it is implemented.

    Best,
    Ernest Marcinko

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


    #30879
    timburkart
    timburkart
    Participant

    Hello Ernest,

    I just want to thank you for this functionality! I have confirmed that it works on my site.

    Best regards,

    Tim Burkart

    #30889
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You are welcome, thank you for the feedback!

    Best,
    Ernest Marcinko

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


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

You must be logged in to reply to this topic.