Formidable Forms

Formidable Forms

  • Features
  • Pricing
  • Resources
    • Docs & Support
    • Blog
    • Community
  • Solutions
    • Web Applications
    • Calculators
    • Surveys
    • Directories
    • Payments
    • Contact forms
  • Login
  • Get Formidable Forms

WPML

Last Updated: September 17, 2021

Knowledge Base → Add-Ons → Multilingual → WPML

Translate your forms into multiple languages using WPML and the Formidable Multilingual add-on.

Formidable Forms is the best WordPress Form Builder plugin. Get it for free!

Download and install

Formidable Multilingual requires that your WPML account type includes access to the following plugins: WPML Multilingual CMS, and WPML Translation Management. These plugins are bundled with either WPML Multilingual CMS or WPML Multilingual Agency.

  1. If you haven't already done so, install and activate Formidable Forms Pro.
  2. In your WordPress admin, go to Formidable → Add-Ons and click the Install button for the Multilingual add-on.

Translate a form

After the three WPML plugins and the Formidable Multilingual add-on are activated, you may follow the steps below to translate your forms.

  1. Go into edit a form that you would like to translate. Click on Settings and click the Translate Form button.
    WPML Translate Form Button
  2. Enter your translations. If you would like to prevent a translation from being used, uncheck the 'Complete' box.
    WPML Translate Form Enter Translation
  3. Publish your form on a page and use WPML to translate the page to any other languages you would like to use.
    WPML Translate Form Publish Page

Translate a View

When translating Views, you need to create separate Views for each language. Follow the instructions below to get started.

  1. Create a View for the default language. For this example, use English.
  2. On the left sidebar of your View builder, look for the Metaboxes → Language section. Click the + Translate icon to create the translated View for the second language.
    WPML Translate View Language
    You will be redirected to a new View, where you can add your translation.
  3. Publish the View for the default language.
  4. From the right sidebar of the page editor, look for the Page → Language section. Click the + Translate icon to create the translated page for the second language.
    WPML Translate View Publish PageYou will be redirected to a new page where you can add your translation.
  5. You can either insert the Formidable shortcode manually or use the Formidable Views block to publish the second language View on the new page.

Set datepicker language

Follow these steps to make the datepicker field in your form use a different locale.

  1. Open the field settings for your date field and set the locale.
  2. Go to the form translation page for this form.
  3. Select your preferred datepicker language from the dropdown for each language you are translating to.
    Set multilingual datepicker language

Sending translated emails

To send the email for the correct language, you'll need to set up multiple email form actions. Each of these emails will be sent conditionally, based on the language submitted.

  1. In your form builder, add a hidden field.
  2. Activate this code snippet and use [current_wpml_lang] as the default value for your hidden field.
    WPML Email hidden field
  3. In your form Settings → General page, click the Translate Form button to add the translations for your form and publish it on a page.
  4. In your form Settings → Actions & Notifications page, create an email action for each language that you want to translate. Set them up however you'd like.
    WPML Email Form Actions
  5. To ensure that the correct email is sent depending on the language, add conditional logic to each one. For example, use en for English and es for Spanish.
    Please note that Conditional Logic is only available in the premium version of Formidable Forms. Your conditional logic will look like this:
    WPML Email Conditional Logic

Redirect based on site language

In order to redirect to the correct translated page after form submission, follow these steps to get the current language that the user is currently viewing.

  1. Add a hidden field to your form.
  2. Insert the following shortcode in the hidden field to get the current language.
    [current_wpml_lang]
  3. In your form's → Settings → Redirect URL, you can add this conditional statement:
    http://site.com/thank-you/?lang=[x]

    Where x is the hidden field ID containing the current language.

  4. In your WPML settings → Language URL format, choose the Language name added as a parameter.

Redirect Login Form

If you have added a Login form using the User Registration add-on, you might be redirected to the default language after logging in or logging out. To set up a redirect to the language you want to use, you could do the following:

  1. Go to your Login page and click Edit Translation. For this example, the default language is Spanish, and the second language is English.
    WPML Login Form Translation
  2. Insert the login shortcode on your page.
    [frm-login redirect="/en/login/" logout_redirect="/en/login/"]

    WPML Login Form Redirect

  3. If you have set your WPML Language URL format to set the Language name as a parameter, your shortcode could look like this instead:
    [frm-login redirect="/login/?lang=en" logout_redirect="/login/?lang=en"]

    WPML Login Form Redirect Param

Set the reCaptcha language

In your Formidable → Global Settings → reCaptcha, select "Browser Default" as the reCAPTCHA Language. This will set the browser language to be used for the reCaptcha.
WPML reCAPTCHA Language browser default

Translate values in custom HTML

If you have content in the form Settings → Customize HTML page that you want to translate, follow the instructions below to get started.

  1. Activate this code snippet to get the current language.
  2. Surround the content with frm-condition to only show it if the current language matched. Use current_wpml_lang as the source.
  3. For example, if the current language is French and you want to display its translated value, your final shortcode may look something like:
    [frm-condition source=current_wpml_lang equals="fr"]Afficher le contenu[/frm-condition]

    Replace fr with your selected language.

Troubleshooting

Default language always shows

If the default language is always showing after setting up and saving your translation, this is usually related to settings in WPML. It works best if the default language in the WPML settings is the same and the default language set for the string translations.

English translation not working

If you have translated your form from a default language other than English (e.g. Italian), the translations may not show up. Try the following steps to resolve the issue:

  1. Go to the WPML → String translation page and search for the string that is not translating.
  2. Select the string and change the selected string language to your site's default language.
    WPML String Translation default language

If this does not resolve the issue, please create a ticket in the help desk for assistance.

Conditional logic not working

If you have added conditional logic to a field, this may break when you translate your form to a non-default language. To resolve this issue, enable separate values in your radio, dropdown, and checkbox fields. This way, only the displayed value is translated and the conditional logic will work across languages.

Error: Call to a member function

If you see this error message, check each of the following:

  1. Are Formidable Forms, Formidable Forms Pro, and Formidable Multilingual up to date? If not, please update.
  2. Are WPML Multilingual CMS and WPML Translation Management up to date? If not, please update.
  3. Do you have the Polylang plugin installed? If so, you'll need to choose between the two. They are currently not designed to work together.
  4. Do you have another plugin installed that uses WPML or Polylang? If so, try deactivating it to check for a conflict.

Additional customizations

These code examples can be added to a child theme's functions.php file or the Code Snippets plugin (recommended). To learn more about how to use code examples like this, see the Formidable Hooks guide.

Get the current language

Use [current_wpml_lang] to get the current language by adding the code below.

add_shortcode( 'current_wpml_lang', 'current_wpml_lang' );
function current_wpml_lang() {
  return apply_filters( 'wpml_current_language', null );
}

Related Articles

  • WPML vs Polylang translation plugins compared WordPress WPML vs Polylang: Translation Plugins Compared
    Read More
    how to create multilingual forms in WordPress How to Create Multilingual Forms in WordPress
    Read More
    why you should translate WordPress forms Why You Need to Translate Your WordPress Forms
    Read More
  • Best Translation Plugins for WordPress 5 Best WordPress Translation Plugins [Compared]
    Read More
  • Download and install
  • Translate a form
  • Translate a View
  • Set datepicker language
  • Sending translated emails
  • Redirect based on site language
  • Redirect Login Form
  • Set the reCaptcha language
  • Translate values in custom HTML
  • Troubleshooting
    • Default language always shows
    • English translation not working
    • Conditional logic not working
    • Error: Call to a member function
  • Additional customizations
    • Get the current language
  • Related Articles
Categories
×

Categories

  • Installation & Getting Started
  • Account Management
  • Forms
  • Entries
  • Views
  • Styles
  • Importing & Exporting
  • Add-Ons
  • Extend Formidable Forms

Using WordPress and want to get Formidable Forms for free?

Get Formidable Forms Lite Now

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

Take on bigger projects Right Now

Get the tools you need to revolutionize your workflow and architect a masterpiece. Build the most advanced WordPress forms and actually use the data you collect in meaningful ways.

Get the most advanced WordPress form plugin and the only form builder with integrated Views.

Get Formidable Forms Now

Resources

  • Community
  • Affiliates
  • Contact
  • Free Online Form Builder

Top Features

  • Application Builder
  • Calculator Forms
  • Surveys & Polls
  • Quiz Maker
  • Form Templates
  • Application Templates
  • Directories
  • Donation Plugin

Company

  • About Us
  • Giving Back
  • Careers
  • Newsletter
  • WP Tasty
  • Nutrifox

Copyright © 2023 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.
Privacy Policy | Terms of Service | Sitemap

Join 300,000+ using Formidable Forms to create form-focused solutions fast. Get Started See User Reviews