Skip to content Skip to sidebar

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

Problem:
The client is using Astra Theme and Spectra Blocks and is unable to translate a button on their website.
Solution:
We recommend adding the following code to WPML > Settings > Custom XML Configuration:

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="uagb/call-to-action" translate="1">
      <xpath>//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6]</xpath>
      <xpath>//p[@class="uagb-cta__desc"]</xpath>
      <xpath>//*[@class="uagb-cta__buttons"]</xpath>
      <xpath>//a[@class="uagb-cta__button-link-wrapper"]</xpath>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

After adding the code, make a small modification and save, then update the translation.

If this solution does not resolve your issue, or if it seems outdated or irrelevant to your case, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket at WPML support forum.

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 Dražen 1 year, 10 months ago.

Assisted by: Dražen.

Author Posts
June 13, 2024 at 11:05 am #15735613

svenjaK-2

Background of the issue:
I use Astra Theme and Spectra Blocks on my site hidden link. I am trying to translate a button on the page hidden link in the last box with the text 'Vous cherchez plus d'informations...'. I was able to translate the text of the CTA, but I do not find the button to translate it.

Symptoms:
I am not able to translate the button.

Questions:
What can I do to translate the button?

June 13, 2024 at 11:20 am #15735763

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

I created a minimal installation of WordPress, WPML, and all necessary WPML add-ons.

You can access the WordPress dashboard using the link below:
- hidden link

Kindly follow the steps below:
- Set up WPML
- Install the necessary plugins.
- Try to replicate the issue.
- Share with me step by step guide on how can I check the issue

This will help us to report the probable issue to the compatibility team and solve the possible problem faster.

Regards,
Drazen

June 13, 2024 at 2:03 pm #15736668

svenjaK-2

Hello,

please have a look at the sandbox.

on the site "test" you can see the call to action box with a button saying "Read More"

If you switch to the french site, you can see that the button still says the english "read more" and is not translated to french

By the way, I did not receive an email notification

June 13, 2024 at 3:10 pm #15737050

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

thanks for taking the time to recreate the issue. I am trying the same my self on a new test site, so I can escalate this issue to our company team, but it seems it is working.

I am not sure if I am missing some steps, I installed the Spectra plugin and added a Container block and inside CTA with the button, but the button text shows up for translation.

Can you please check on this new test site and if I am missing any steps? And / OR try to recreate on new page by adding blocks and share step by step guide with me.

Link:
- hidden link

Thanks,
Drazen

June 13, 2024 at 4:17 pm #15737275

svenjaK-2

I created a new page in my sandbox: page 3 and created a new container with a CTA but it does not appear in the translation.

I then added a new page to your sandbox and the same happens: I do not see it in the translation. What am I missing?

I make a new page, insert a paragraph, insert a container (spectra), with only one box inside, then insert the CTA (spectra), save and publish the page.
Then I go to WPML translations management, put the page into the queue, open it for translation- no button to translate.

???

June 14, 2024 at 9:25 am #15739309

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

thanks, I have escalated this to our compatibility team.

I will update you when I have some news, but please note it can take few days.

Regards,
Drazen

June 14, 2024 at 12:16 pm #15740029

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

Add the following code to WPML > Settings > Custom XML Configuration:

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="uagb/call-to-action" translate="1">
			<xpath>//*[self::h1 or self::h2 or self::h3 or self::h4 or self::h5 or self::h6]</xpath>
			<xpath>//p[@class="uagb-cta__desc"]</xpath>
			<xpath>//*[@class="uagb-cta__buttons"]</xpath>
      <xpath>//a[@class="uagb-cta__button-link-wrapper"]</xpath>
		</gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

- Do a small modification and save
- Update the translation

Regards,
Drazen

June 15, 2024 at 10:11 am #15741610

svenjaK-2

thank you, now it is working.

But now I am facing the next problem:

in my table of content, I can translate the heading (content - Inhaltsverzeichnis) but it does not show on the page, it still has the german text.

Then it takes all of the content correctly, but not the cta that we just solved the problem. There the translated table of content takes the german phrase, not the english for the table of content - please see screenshot

You can see it for example on:

hidden link

Bildschirmfoto 2024-06-15 um 12.06.30.png
June 17, 2024 at 6:47 am #15743431

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

if I understand correctly this is about a new widget, called a table of content. Since this could be a specific issue or another compatibility and we limit 1 issue per ticket to keep things clear and in order, please open a new chat/ticket and we will be glad to check and help further.

Thanks,
Drazen