How can I localize the field labels in Contact Form 7


Staff member
I have managed to localize my clients site from Spanish to French:

<a href="" rel="nofollow"></a>

...using a combination of the WPML plugin and the Gettext framework. The only thing i have been unsuccessful translating are the labels on the contact form itslef:

&lt;p&gt;Nombre&lt;br /&gt;
&lt;span class="wpcf7-form-control-wrap your-name"&gt;&lt;input type="text" name="your-name" value=""    class="wpcf7-text wpcf7-validates-as-required" size="40" /&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;Email&lt;br /&gt;
&lt;span class="wpcf7-form-control-wrap your-email"&gt;&lt;input type="text" name="your-email" value="" class="wpcf7-text wpcf7-validates-as-email wpcf7-validates-as-required" size="40" /&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;Teléfono&lt;br /&gt; the text i'm trying to translate would be "Nombre" - to the French.

I've tried the gettext methods that worked for other hard-coded areas:

 &lt;p&gt;&lt;?php _e('Nombre', theme_domain);?&gt;&lt;br /&gt;

 &lt;p&gt;&lt;?php __('Nombre', theme_domain);?&gt;&lt;br /&gt;

...but this does not work.

(i´m adding these into wordpress through admin and not directly to the .php file).

I'm familiar with creating .po / .mo files and know how to localize normal hard-coded text - but contact form 7 has me baffled.

Any suggestions appreciated.