How can I localize the field labels in Contact Form 7 How can I localize the field labels in Contact Form 7 wordpress wordpress

How can I localize the field labels in Contact Form 7


You don't need any of that. Check the link below specially the secition "Creating contact form in different languages"

contact form in your language


I think the solution to your problem lies in the ability to run PHP within the Contact Form 7 template. You can do this by writing your own shortcode and then adding this into CF7.

Firstly, setup a shortcode so your translation functions are available within WP content areas. Something like:

function e_text_shortcode( $atts ) {    extract( shortcode_atts( array(        'text' => 'something',        'theme_domain' => 'something else',    ), $atts ) );    return _e($text, $theme_domain);}add_shortcode('e_text', 'e_text_shortcode');

(disclaimer: I haven't tested this!)

Then you can use a plugin like this one so you can add shortcodes to the CF7 template area. With this plugin you have to define the codes you want to use as 'keys', something like:

e_text key='e_text'

Then you should be able to use e_text shortcode in the CF7 form template and email templates.


Thanks for the suggestion JunkMyFunk. I tried to implement this but ran into some issues.

I eventually found a workaround using the following method:

  1. Install WPML plugin.
  2. Create a contact form for each language in WP CF7
  3. Use the following conditional statement to show the correct contact form for each language.

    <?php if(get_bloginfo('language')=='es-ES') { echo do_shortcode('[contact-form 1 "Contact form 1"]'); } else {   echo do_shortcode('[contact-form 2 "Contact_form_2"]');   } ?>

Thanks for your help all the same -