This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Plugin now works with GTranslate

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

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #29800
    timburkarttimburkart
    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!

    #29807
    Ernest MarcinkoErnest 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.

    #30820
    timburkarttimburkart
    Participant

    Hi Ernest,

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

    Thank you!

    Tim Burkart

    #30833
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Tim,

    Yes, it is implemented.

    #30879
    timburkarttimburkart
    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 MarcinkoErnest Marcinko
    Keymaster

    You are welcome, thank you for the feedback!

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