Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The submit button text in forms created with the Spectra plugin can't be translated.

Solution:
Please try the following steps:

1. Go to WPML > Settings > Custom XML Configuration tab
2. Add the following code and save it:

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="uagb/forms" translate="1">
      <key name="submitButtonText"></key>
      <xpath>//button/div</xpath>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

Relevant Documentation:
https://wpml.org/errata/spectra-wpml-translation-issue-with-spectra-form-submit-button/

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by Mohamed Sayed 1 year, 4 months ago.

Assisted by: Mohamed Sayed.

Author Posts
January 15, 2024 at 12:45 am #15182751

conanK

I am trying to translate a button in the submit form I set on the webpages

Link to a page where the issue can be seen:
hidden link
hidden link
hidden link
hidden link

I expected to see: 預約診症

Instead, I got: Book An Appointment

Screenshot 2024-01-14 115753.png
Screenshot 2024-01-14 115636.png
January 15, 2024 at 10:07 am #15184066

Mohamed Sayed

Hi there,
Thanks for contacting WPML support.

Could you please tell me which plugin you use to create the form?

If the form content is translated in the WPML translation editor, please edit the translation and use the search field to find the button text.

Let me know please if that helps.

Kind regards,
Mohamed

Screenshot_524.png
January 16, 2024 at 10:41 am #15189030

conanK

I created the form by inporting a template from Astra and Spectra theme

January 16, 2024 at 1:47 pm #15190341

Mohamed Sayed

I have created this clean sandbox setup on our servers here:
hidden link (one-click login)

I would need you to please set up WPML + the WPML add-ons as you have them on your site (they are already installed) and also install the Astra theme + Spectra and try to recreate the issue.

Please don't install anything else like plugins that are not necessary, on a clean sandbox we try to use just the WPML plugins and the plugin/theme that's part of the issue

If the issue is going to take place on this clean setup on our servers too, then I can forward this to our compatibility department.

Please let me know how that goes and what you can find.

January 18, 2024 at 9:25 am #15198821

conanK

I've installed the Astra theme and Spectra plugin and created a page for the form. Please check.

January 18, 2024 at 10:59 am #15199348

Mohamed Sayed

Thanks, I escalated this issue to the 2nd tier support team for further investigation. I'll update you once I get their reply.

January 22, 2024 at 9:52 am #15210179

Mohamed Sayed

Thanks for your patience.

Please try the following steps:

1. Go to WPML > Settings > Custom XML Configuration tab
2. Add the following code and save it:

<wpml-config>
  <gutenberg-blocks>
        <gutenberg-block type="uagb/forms" translate="1">
			<key name="submitButtonText"/>
                <xpath>//button/div</xpath>
	</gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

3. Update the page with a minor change
4. Update the translation

Let me know please if that helps.

Kind regards,
Mohamed

January 24, 2024 at 12:30 pm #15221705

conanK

My site currently has existing this code, how should I further embed the code you provide would be the best?

<wpml-config>
<gutenberg-blocks>
<gutenberg-block type="uagb/info-box" translate="1">
<!-- XPath for the entire paragraph area containing the specific text -->
<xpath>//div[contains(@class, 'wp-block-uagb-info-box')]//p[contains(@class, 'uagb-ifb-desc')]</xpath>
<!-- XPath for the h2 tag -->
<xpath>//div[@class='uagb-ifb-content']/div[@class='uagb-ifb-title-wrap']/h2[@class='uagb-ifb-title']</xpath>
<!-- XPath for the h6 tag -->
<xpath>//div[@class='uagb-ifb-content']/div[@class='uagb-ifb-title-wrap']/h6[@class='uagb-ifb-title']</xpath>
<!-- XPath for the h4 title -->
<xpath>//div[@class='wp-block-uagb-info-box']//h4[@class='uagb-ifb-title']</xpath>
<!-- XPath for the 'Read More' button text -->
<xpath>//div[contains(@class, 'wp-block-uagb-info-box')]//div[contains(@class, 'uagb-ifb-button-wrapper')]//span[contains(@class, 'uagb-inline-editing')]</xpath>
<!-- XPath for the 'Surgical Insights' text in the h4 tag -->
<xpath>//div[contains(@class, 'wp-block-uagb-info-box')]//h4[contains(@class, 'uagb-ifb-title')]</xpath>
</gutenberg-block>
</gutenberg-blocks>
</wpml-config>

January 24, 2024 at 1:56 pm #15222175

Mohamed Sayed

Please replace the code you have with the following:

<wpml-config>
    <gutenberg-blocks>
         <gutenberg-block type="uagb/info-box" translate="1">
<!-- XPath for the entire paragraph area containing the specific text -->
<xpath>//div[contains(@class, 'wp-block-uagb-info-box')]//p[contains(@class, 'uagb-ifb-desc')]</xpath>
<!-- XPath for the h2 tag -->
<xpath>//div[@class='uagb-ifb-content']/div[@class='uagb-ifb-title-wrap']/h2[@class='uagb-ifb-title']</xpath>
<!-- XPath for the h6 tag -->
<xpath>//div[@class='uagb-ifb-content']/div[@class='uagb-ifb-title-wrap']/h6[@class='uagb-ifb-title']</xpath>
<!-- XPath for the h4 title -->
<xpath>//div[@class='wp-block-uagb-info-box']//h4[@class='uagb-ifb-title']</xpath>
<!-- XPath for the 'Read More' button text -->
<xpath>//div[contains(@class, 'wp-block-uagb-info-box')]//div[contains(@class, 'uagb-ifb-button-wrapper')]//span[contains(@class, 'uagb-inline-editing')]</xpath>
<!-- XPath for the 'Surgical Insights' text in the h4 tag -->
<xpath>//div[contains(@class, 'wp-block-uagb-info-box')]//h4[contains(@class, 'uagb-ifb-title')]</xpath>
</gutenberg-block>
      <gutenberg-block type="uagb/forms" translate="1">
			<key name="submitButtonText"/>
      <xpath>//button/div</xpath>
		</gutenberg-block>
    </gutenberg-blocks>
</wpml-config>