Forums Forums Search & Filter Pro Make it compatible for on-fly translation

Viewing 8 posts - 1 through 8 (of 8 total)
  • Anonymous
    #36101

    Hello,
    I am using GTranslate plugin and would like SF2 ajax form results to be translated.
    I got this from Gtranslate support:

    ——-
    You have this form:

    <form action=”http://en.tracers.ru/archive/&#8221; method=”post” class=”searchandfilter” data-sf-form-id=”17942″ data-is-rtl=”0″ data-results-url=”http://tracers.ru/archive/&#8221; data-ajax-url=”http://tracers.ru/?sfid=17942&sf_action=get_results&#8221; data-ajax-form-url=”http://tracers.ru/?sfid=17942&sf_action=get_form&#8221; data-use-history-api=”1″ data-template-loaded=”0″ data-lang-code=”” data-ajax=”1″ data-ajax-target=”#search-filter-results-17942″ data-ajax-links-selector=”.pagination a” data-update-ajax-url=”1″ data-only-results-ajax=”1″ data-scroll-to-pos=”0″ data-auto-update=”1″ id=”search-filter-form-17942″ autocomplete=”off”>

    You will need to change data-results-url, data-ajax-url, data-ajax-form-url attributes to be relative or to include the language code like in action attribute. This attributes are not standard attributes like action, that’s why they are not getting replaced with appropriate language domain automatically.

    Thanks! – See more at: http://gtranslate.net/forum/ajax-filter-resets-language-t4636.html#sthash.jFV69pbs.dpuf
    ——-

    Can you tell me where should I make change in code?

    Thank you,
    Oleg

    Ross Moderator
    #36102

    Hey Oleg

    Take a look here:

    http://www.designsandcode.com/documentation/search-filter-pro/action-filter-reference/#Modify_URLs

    These might help – but the only language plugins we “officially” support are WPML and PolyLang.

    Thanks

    Anonymous
    #36113

    Hi,
    I added function with this parameter sf_ajax_results_url (I am using shortcode) and tried other but got no effect. Also what does ‘Available since v2.2’ in docs mean? I have SF2.1 installed.
    Problem page is tracers.ru/archive (lang widget on top left corner). When I change category language resets.

    Anonymous
    #36114

    P.S. I add function to functions.php, right?

    Anonymous
    #36116

    I see – it’s supported since 2.1.2.
    Please take a look. It’s not working for me I think.

    Ross Moderator
    #36149

    Can you try the following in functions.php and send me a link to a page with the search form on?

    function change_sf_url( $url,  $sfid) {
      // Process URL here
      //return $url;
      return "http://www.google.com/";
    }
    add_filter( 'sf_results_url', 'change_sf_url', 10, 2 );
    add_filter( 'sf_ajax_results_url', 'change_sf_url', 10, 2 );
    add_filter( 'sf_ajax_form_url', 'change_sf_url', 10, 2 );

    This should replace any links with google.com – let me know if its not updating and send me a link so I can inspect.

    Thanks

    Anonymous
    #36211
    This reply has been marked as private.
    Ross Moderator
    #36279

    Did you try the code I supplied and add it to functions.php? What happened when you tried it?

    Thanks

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