Hi @m1k3w,
Trust you are doing good and thank you for reaching out to us.
the part i am confused about is how to add the forms to the various languages
For each language version, WPML creates a new post/page. Please try using replace the Forminator shortcode with the corresponding language version of the form on each language version or the post/page.
I hope that helps.
Kind Regards,
Nebu John
Thread Starter
m1k3w
(@m1k3w)
thanks in my case i’m using divi and on the pages section against a page it has the option to add translations on what it has picked from the page to add translations, so i cant access the actual translated page
i however decided on the base page to show the relevant short code based off the url like
function multilingual_form_shortcode() {
$url = $_SERVER['REQUEST_URI'];
if (strpos($url, '/fr/') !== false) {
return do_shortcode('[french-form_shortcode"]');
} elseif (strpos($url, '/de/') !== false) {
return do_shortcode('[german-form_shortcode]');
} elseif (strpos($url, '/da/') !== false) {
return do_shortcode('[danish-form_shortcode]');
} elseif (strpos($url, '/es/') !== false) {
return do_shortcode('[spanish-form_shortcode]');
} else {
return do_shortcode('[english-form_shortcode"]');
}
}
add_shortcode('multilingual_form', 'multilingual_form_shortcode');
then just add the shortcode to the page you need it
hope this helps anyone with the same issue
-
This reply was modified 1 year, 10 months ago by
m1k3w.
-
This reply was modified 1 year, 10 months ago by
m1k3w.
Hi @m1k3w
Good solution, you can also use the https://wpml.org/wpml-hook/wpml_current_language/
Thank you for sharing the final code I believe it will help more users too.
I am marking this as resolved but feel free to ping us if you need any additional help.
Best Regards
Patrick Freitas