Forums › Forums › Search & Filter Pro › Make it compatible for on-fly translation
- This topic has 7 replies, 2 voices, and was last updated 8 years, 9 months ago by Ross.
-
Anonymous(Private) February 3, 2016 at 8:12 am #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/” method=”post” class=”searchandfilter” data-sf-form-id=”17942″ data-is-rtl=”0″ data-results-url=”http://tracers.ru/archive/” data-ajax-url=”http://tracers.ru/?sfid=17942&sf_action=get_results” data-ajax-form-url=”http://tracers.ru/?sfid=17942&sf_action=get_form” 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,
OlegRoss Moderator(Private) February 3, 2016 at 8:54 am #36102Hey 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(Private) February 3, 2016 at 11:57 am #36113Hi,
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.Ross Moderator(Private) February 3, 2016 at 7:53 pm #36149Can 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
Ross Moderator(Private) February 4, 2016 at 11:34 pm #36279Did you try the code I supplied and add it to functions.php? What happened when you tried it?
Thanks
-
AuthorPosts