Salta la navigazione

Resolved

Reported for: Contact Form 7 Multilingual 1.1.0

Resolved in: 1.2.1

Topic Tags: Compatibility

Overview of the issue

The Contact Form 7 plugin allows you to set placeholders in your forms. However, if you are using WPML’s Translate Everything feature, you will find that they are not translated automatically.

This is a known limitation from our Advanced Translation Editor as explained in our documentation. You need to manually select your form placeholders and send them for translation.

Workaround

Please, make a full backup of your site before proceeding.

  • Open wp-content/plugins/contact-form-7-multilingual/classes/Placeholders.php file.
  • Look for line 40.
  • Replace:
    			// $addEqualSignOnPlaceholder :: string -> string
    			$addEqualSignOnPlaceholder = Str::replace( 'placeholder "', 'placeholder="' );
    
  • With:
    			// $addEqualSignOnPlaceholder :: string -> string
    			$addEqualSignOnPlaceholder = Str::replace( 'placeholder "', 'placeholder "' );
    
    

2 risposte a “Contact Form 7 - "Placeholders" attributes are not translatable via Translate Everything mode”

  1. When adding an equal sign between the attribute name and its value, the placeholder doesn’t acting as it should anymore and becomes a “default value” which break the idea of a placeholder itself. Maybe I missed something but the solution provided doesn’t look good to me.