Back to Community

How to Translate Checkout Fields with Polylang and WPML

Content

Translating custom checkout fields created with the 'Checkout Field Editor (Checkout Manager) for WooCommerce' plugin is a common challenge for multilingual sites. This guide explains the core issue and provides the most effective solutions based on community reports.

Why This Happens

The free version of the 'Checkout Field Editor' plugin does not natively integrate with popular multilingual plugins like WPML or Polylang. This means the text strings for your custom field labels, placeholders, and options are not automatically detected by these translation systems.

Common Solutions

1. For Polylang Users: Install a Helper Plugin

Many users have reported success by installing the free "Theme and plugin translation for Polylang (TTfP)" plugin. This plugin helps Polylang detect strings from themes and plugins that it might otherwise miss.

Steps:

  1. Install and activate the Theme and plugin translation for Polylang plugin.
  2. Go to Languages > Settings > TTfP settings in your WordPress admin.
  3. Ensure that "checkout-form-designer" or a similar plugin slug is selected for scanning.
  4. Go to Languages > String translation to find and translate your checkout field strings.

2. The Manual Translation File (.po/.mo) Method

This is the officially suggested method for the plugin's free version and works with any language. It involves creating translation files.

Steps:

  1. Use a translation tool like Poedit.
  2. Locate the plugin's `.pot` file (template) in the /wp-content/plugins/woo-checkout-field-editor-pro/languages/ directory.
  3. Create a new translation for your language (e.g., fr_FR.po for French).
  4. Translate all the necessary strings (msgid) into your target language (msgstr).
  5. Save the file, which will generate a compiled .mo file. Upload both the .po and .mo files to the plugin's language directory.

Important Note: If a text string you need to translate (like "Billing Fields") is not in the original .pot file, you must manually add it using the correct format before translating:

msgid "Billing Fields"
msgstr ""

3. Using a Custom Code Snippet (For Developers)

For a small number of hard-to-translate strings, you can use a WordPress filter. This code snippet, added to your child theme's functions.php file, changes the text output.

//Change the 'Billing Fields' checkout label to 'Contact Information'
function wc_billing_field_strings( $translated_text, $text, $domain ) {
    switch ( $translated_text ) {
        case 'Billing Fields' :
            $translated_text = __( 'Your Translated Text Here', 'woocommerce' );
            break;
    }
    return $translated_text;
}
add_filter( 'gettext', 'wc_billing_field_strings', 20, 3 );

What Doesn't Work

  • WPML String Translation: The free version of the checkout field editor is not compatible with WPML. Strings will not appear for translation in the WPML interface.
  • Polylang Alone: Without the TTfP helper plugin, Polylang often cannot detect the field strings, so translations will not appear on the frontend.

Conclusion

For Polylang users, installing the "Theme and plugin translation for Polylang" plugin is the most straightforward solution. For other setups or if you prefer more control, creating manual .po and .mo translation files is the recommended approach. Always clear your cache after implementing any translation solution.

Related Support Threads Support