Forums › Forums › Search & Filter Pro › Issue: Form redirection to another language form + Multisite doubt
Tagged: issue, issues, language, multisite, polylang, redirection, shortcode, translation
- This topic has 11 replies, 4 voices, and was last updated 8 years, 2 months ago by
Trevor.
-
Trevor(Private) April 19, 2017 at 12:53 pm #103761
That code is wrong, it should be:
<?php if ( get_bloginfo('language') == 'es-ES' ):?> <h3>Buscador</h3> <?php echo do_shortcode('[searchandfilter id = "928"]'); else:?> <h3>Cercador</h3> <?php echo do_shortcode('[searchandfilter id = "930"]'); endif?>
I am not sure if would work; I simply corrected the coding errors.
Trevor(Private) April 20, 2017 at 9:07 am #103974There are two forms there, 928 and 930. Which one is Spanish and Which one is Catalan
Did you try echoing the language code, like this:
<?php $blog_language = get_bloginfo('language'); if ( $blog_language == 'es-ES' ):?> <h3>Buscador (language: <?php echo $blog_language;?>)</h3> <?php echo do_shortcode('[searchandfilter id = "928"]'); else:?> <h3>Cercador (language: <?php echo $blog_language;?>)</h3> <?php echo do_shortcode('[searchandfilter id = "930"]'); endif?>
Anonymous(Private) April 20, 2017 at 12:33 pm #104010yes, but it doesn´t fix the problem altough i fixed it casualy.
The solution was to deactivate ajax of the form in Catalan and it works
The problem must have been ajax and some conflict that recharges erroneously.I have seen that if I delete the conditional that loads the shortcodes according to language, I can see the translated form, but ajax does not work in that case, however, if if I keep the conditional with the shortcodes and disable ajax in the Catalan form, ajax works (and I can also see the form in Catalan)
What is the best way to work with a two-language form and shortcodes?
Did not answer me but, will this work in multisite?
Thank you
Regards
Ross Moderator(Private) April 21, 2017 at 9:37 am #104173Hi there
In general you should not need a conditional to display the correct form for each language,
S&F will detect the current language and show the correct form if there is a translation.
Although, you mention a strange ajax issue…
Anyway, regarding the mix of languages, sometimes issues occur when taxonomies/terms are not translated.
Did you create translations for your taxonomies and your terms in Polylang?
If not, create translation for all, then rebuild S&F cache, and test again.
Let me know how you get on.
Best
Anonymous(Private) April 21, 2017 at 12:16 pm #104192Thank you for the reply
I have removed the language conditional in both templates and only show the shortcode of the Spanish language and displays the form that corresponds to each language. 🙂Regarding taxonomies, what I have translated are the terms.
I have a taxonomy called activity_type and within 3 terms (courses, seminars and days), these terms if they have a translation.Polylang offers manual translation of the terms, and for taxonomy, I know it has to be activated in the polylang settings, but I only see one taxonomy common to both languages (if I change a parameter in the taxonomy in Spanish, it also changes in Catalan)
Anonymous(Private) April 22, 2017 at 12:20 am #104268Hi, I have a similar problem, the form works fine in English but I don’t get any results in French…
http://www.intheloup.laAnonymous(Private) April 25, 2017 at 1:08 pm #104717Hi,
I think it´s not a problem of translation of the taxonomy, since it correctly shows the posts that are classified under the terms in each language.
Any idea why ajax does not work ajax in the opposite language?.You can check it at this link: Site
I will keep the ajax while you reply me.
Thanks
Regards
-
AuthorPosts