Skip Navigation

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

Problem:
If you're experiencing issues with buttons on your homepage not redirecting to the correct language after a language change, and your site uses custom blocks from the Kubio plugin, the URL field of the block may not be registered for translation.
Solution:
First, try searching for the URL in the Advanced Translation Editor (ATE). If it's not available, you'll need to register the URL field for translation. You can do this by creating a custom XML configuration code. Here are the steps:
1. Edit the homepage with the default editor and switch to the Code editor to view the block structure.
2. Use the following XML code to register the button text and URL for translation:


<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="kubio/button" translate="1">
      <xpath>/*</xpath>
      <key name="link">
        <key type="link" name="value"></key>
      </key>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

3. Add this code to WPML > Settings > Custom XML Configuration.
4. Make a small change to the page content, save it, and update the translation. The button URL should now be adjusted automatically.
For more detailed guidance, please refer to our documentation:

If this solution does not apply to your case because it might be outdated or not relevant, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket.

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.

This topic contains 8 replies, has 2 voices.

Last updated by Long Nguyen 6 months, 4 weeks ago.

Assisted by: Long Nguyen.

Author Posts
April 10, 2024 at 11:02 pm #15506597

robertoR-47

Now we are having problems with the buttons on the home page, even after the person changes language, the buttons just below the first screen, where the names of the tours are, are redirected to the website in German.

April 11, 2024 at 2:06 am #15506789

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Roberto,

Thank you for contacting WPML support, I’m happy to help you with this issue.

I see the Tours section on the homepage is created by a custom block from the plugin Kubio on your site.

First thing, I suggest you search for the URL in the Advanced Translation Editor (ATE) and translate it. If it isn't available there, it is possible that the URL field of the block is not registered for translation.
Then you can follow the documentation below to create a custom XML configuration code to register the URL field in the block for translation and search for it in the ATE again.

Refer documentation
https://wpml.org/documentation/support/language-configuration-files/make-custom-gutenberg-blocks-translatable/
https://wpml.org/faq/how-to-translate-urls-shortcodes-and-html-attributes-using-the-advanced-translation-editor/

Looking forward to your reply.
Thanks

April 13, 2024 at 4:06 am #15514400

robertoR-47

Honestly, I didn't understand almost anything, I'll send you an example of a kubio block, please tell me exactly how I should change it there.

hidden link">
<span class="position-relative wp-block-kubio-button__text style-JDZCnJp-vBR-text style-local-55-text kubio-inherit-typography">
CUMBUCO – JERICOACOARA
</span>

Should the code look like this?

<kubio-blocks>
<kubio-block type="core/some-block" translate="1">
<xpath type="link">//a/@href</xpath>
</kubio-block>
</kubio-blocks>

please tell me exactly how I should change it there.

April 15, 2024 at 2:02 am #15516899

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated. Your next reply is set to private to share the info.

❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme to change configurations on the site if needed. This is also a reason the backup is critical.

Looking forward to your reply.
Thanks

April 15, 2024 at 7:34 am #15517384

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

If you edit the homepage with default editor and switch to Code editor, you can see the block structure:

<!-- wp:kubio/button {"kubio":{"styleRef":"JDZCnJp-vBR","props":{"buttonWidth":"fitToContent","iconPosition":"before","showIcon":false,"buttonSize":"medium","horizontalAlign":"center"},"style":{"descendants":{"link":{"background":{"color":"rgba(var(--kubio-color-5),1)"},"border":{"top":{"radius":{"right":{"value":6,"unit":"px"},"left":{"value":6,"unit":"px"}},"color":"rgba(var(--kubio-color-5),1)","style":"solid","width":{"value":"2","unit":"px"}},"bottom":{"radius":{"right":{"value":6,"unit":"px"},"left":{"value":6,"unit":"px"}},"color":"rgba(var(--kubio-color-5),1)","style":"solid","width":{"value":"2","unit":"px"}},"left":{"color":"rgba(var(--kubio-color-5),1)","style":"solid","width":{"value":"2","unit":"px"}},"right":{"color":"rgba(var(--kubio-color-5),1)","style":"solid","width":{"value":"2","unit":"px"}}},"textAlign":"center","typography":{"color":"#012462","family":"Urbanist","margin":{"top":"","bottom":"2rem"},"size":{"unit":"px","value":"12"},"weight":"600","lineHeight":{"value":"1","unit":""},"transform":"uppercase","letterSpacing":{"value":"1","unit":"px"}},"padding":{"top":{"unit":"px","value":"12"},"bottom":{"unit":"px","value":"12"},"left":{"unit":"px","value":"24"},"right":{"unit":"px","value":"24"}},"states":{"hover":{"background":{"color":"rgba(var(--kubio-color-5),1)"},"typography":{"color":"#4583f2"},"border":{"top":{"color":"rgba(var(--kubio-color-5),1)"},"left":{"color":"rgba(var(--kubio-color-5),1)"},"right":{"color":"rgba(var(--kubio-color-5),1)"},"bottom":{"color":"rgba(var(--kubio-color-5),1)"}}}}},"icon":{"size":{"unit":"px","value":"12"},"margin":{"left":{"value":"0","unit":"px"},"right":{"value":"10","unit":"px"}}}}},"hash":"-RLIbqAGp"},"link":{"value":"<em><u>hidden link</u></em>","typeOpenLink":"sameWindow","noFollow":false,"lightboxMedia":""},"preserveSpace":{"text":false},"icon":{"name":"font-awesome/star"}} -->
CUMBUCO - JERICOACOARA
<!-- /wp:kubio/button -->

I register the button text and URL for translation with this XML code:

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="kubio/button" translate="1">
      <xpath>/*</xpath>
      <key name="link">
        <key type="link" name="value" />
      </key>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

it is added to WPML > Settings > Custom XML Configuration. Then I make a small change to the page content > Save > Update the translation and you can see the button URL is adjusted automatically.

Looking forward to your reply.
Thanks

Screenshot 2024-04-15 at 14.32.02 2024-04-15 14-32-24.jpg
Edit Page “Home” ‹ Downwind Kitesafari — WordPress 2024-04-15 13-48-02.png
April 17, 2024 at 1:33 am #15528712

robertoR-47

And how do I translate this part of the header? I can only edit the German part. Below is an image to illustrate.

1.jpg
April 17, 2024 at 3:45 am #15528967

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

It's the template part. You can go to WPML > Translation Management > Filter type "Template Part" > Translate the template "Front Header".

Refer documentation https://wpml.org/documentation/getting-started-guide/translating-content-created-using-gutenberg-editor/translating-sites-that-use-full-site-editing/

Looking forward to your reply.
Thanks

Translation Management ‹ Downwind Kitesafari — WordPress 2024-04-17 10-41-11.png
April 17, 2024 at 4:20 pm #15534009

robertoR-47

When I click on edit it gives the following message:

"The theme you are currently using is not compatible with the site editor."

If you see in the image above that you sent, the other 3 languages are pending update.

Where to manually update these 3 languages?

April 19, 2024 at 2:43 am #15541586

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

When I click on edit it gives the following message:

You should edit the header template in the admin area > Kubio.

Where to manually update these 3 languages?

Please follow steps below to translate the header template:

1. Go to WPML > Translation Management > Select the header template and languages > Assign to translator > Add to Translation Basket.
2. Go to Translation Management > Translation Basket > Send items for translation.
3. Go to WPML > Translations > Take the job and translate the template.

it has already added to the documentation https://wpml.org/documentation/getting-started-guide/translating-content-created-using-gutenberg-editor/translating-sites-that-use-full-site-editing/

Thanks.

Translation Management ‹ Downwind Kitesafari — WordPress 2024-04-19 09-39-07.png
Translation Management ‹ Downwind Kitesafari — WordPress 2024-04-19 09-37-57.png