Contact form is not translated.
-
Hello,
The contact form using this plugin cannot be translated.
When the Translate Site is displayed, only the form is displayed in html format.
<div class="wpforms-container wpforms-container-full" id="wpforms-97"><form id="wpforms-form-97" class="wpforms-validate wpforms-form wpforms-ajax-form" data-formid="97" method="post" enctype="multipart/form-data" action="/en/?trp-edit-translation=preview"><div class="wpforms-field-container"><div id="wpforms-97-field_0-container" class="wpforms-field wpforms-field-name" data-field-id="0"><label class="wpforms-field-label" for="wpforms-97-field_0">Jméno a P?íjmení <span class="wpforms-required-label">*</span></label><div class="wpforms-field-row wpforms-field-medium"><div class="wpforms-field-row-block wpforms-first wpforms-one-half"><input type="text" id="wpforms-97-field_0" class="wpforms-field-name-first wpforms-field-required" name="wpforms[fields][0][first]" required><label for="wpforms-97-field_0" class="wpforms-field-sublabel after wpforms-sublabel-hide"><trp-gettext data-trpgettextoriginal=14>First</trp-gettext></label></div><div class="wpforms-field-row-block wpforms-one-half"><input type="text" id="wpforms-97-field_0-last" class="wpforms-field-name-last wpforms-field-required" name="wpforms[fields][0][last]" required><label for="wpforms-97-field_0-last" class="wpforms-field-sublabel after wpforms-sublabel-hide"><trp-gettext data-trpgettextoriginal=16>Last</trp-gettext></label></div></div></div><div id="wpforms-97-field_1-container" class="wpforms-field wpforms-field-email" data-field-id="1"><label class="wpforms-field-label" for="wpforms-97-field_1">Email <span class="wpforms-required-label">*</span></label><input type="email" id="wpforms-97-field_1" class="wpforms-field-medium wpforms-field-required" name="wpforms[fields][1]" required></div><div id="wpforms-97-field_5-container" class="wpforms-field wpforms-field-text" data-field-id="5"><label class="wpforms-field-label" for="wpforms-97-field_5">Telefon</label><input type="text" id="wpforms-97-field_5" class="wpforms-field-medium" name="wpforms[fields][5]" ></div><div id="wpforms-97-field_2-container" class="wpforms-field wpforms-field-textarea" data-field-id="2"><label class="wpforms-field-label" for="wpforms-97-field_2">Komentá? <span class="wpforms-required-label">*</span></label><textarea id="wpforms-97-field_2" class="wpforms-field-small wpforms-field-required" name="wpforms[fields][2]" required></textarea></div></div><div class="wpforms-field wpforms-field-hp"><label for="wpforms-97-field-hp" class="wpforms-field-label">Comment</label><input type="text" name="wpforms[hp]" id="wpforms-97-field-hp" class="wpforms-field-medium"></div><div class="wpforms-submit-container" ><input type="hidden" name="wpforms[id]" value="97"><input type="hidden" name="wpforms[author]" value="1"><input type="hidden" name="wpforms[post_id]" value="5"><button type="submit" name="wpforms[submit]" class="wpforms-submit " id="wpforms-submit-97" value="wpforms-submit" aria-live="assertive" data-alt-text="Sending..." data-submit-text="Odeslat">Odeslat</button><img src="//www.varnsdorfskapradelna.cz/wp-content/plugins/a3-lazy-load/assets/images/lazy_placeholder.gif" data-lazy-type="image" data-src="https://www.varnsdorfskapradelna.cz/wp-content/plugins/wpforms-lite/assets/images/submit-spin.svg" class="lazy lazy-hidden wpforms-submit-spinner" style="display: none;"><noscript><img src="https://www.varnsdorfskapradelna.cz/wp-content/plugins/wpforms-lite/assets/images/submit-spin.svg" class="wpforms-submit-spinner" style="display: none;"></noscript></div></form></div> <!-- .wpforms-container -->
If I copy and translate it, it doesn’t affect it and disappears when you edit it again.
The only option is to use javascript.
jQuery(document).ready(function() { if (window.location.href.includes("/en/")) { document.getElementsByClassName("wpforms-field-label")[0].innerHTML = "Name and Surname"; document.getElementsByClassName("wpforms-field-label")[2].innerHTML = "Phone"; document.getElementsByClassName("wpforms-field-label")[3].innerHTML = "Comment"; document.getElementsByClassName("wpforms-submit")[0].innerHTML = "Submit"; } });
This code translates it, but it is completely dependent on the position of each field.
In addition, in this way it is not possible to translate the confirmation text after sending.Please for advice.
Thank you
The page I need help with: [log in to see the link]
- The topic ‘Contact form is not translated.’ is closed to new replies.