Skip Navigation

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

Problem:

I am trying to translate a page in which there is a YouTube video.

Link to a page where the issue can be seen:
Original page: https://tiwal.com/faq/disassemble-tiwal-dinghy/
Translated page: https://tiwal.com/en/faq/disassemble-tiwal-dinghy/
I expected to see: the video, not the YouTube address...

Instead, I got: only the YouTube address instead of the block

Solution:

please go to WPML > Settings > Custom XML configuration and add next code:

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="core/embed" translate="1">
      <key name="url" type="LINE"></key>
      <xpath>//figure/div</xpath>
    </gutenberg-block>
    <gutenberg-block type="core/video" translate="1">
      <key name="id"></key>
      <xpath>//figure/video</xpath>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

Make a small change to the default language page and re-translate, save.

Relevant Documentation:

https://wpml.org/documentation/support/language-configuration-files/make-custom-gutenberg-blocks-translatable/

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 21 replies, has 3 voices.

Last updated by Osama Mersal 1 year ago.

Assisted by: Osama Mersal.

Author Posts
October 24, 2023 at 11:57 am #14647267

T4ng

I am trying to translate a page in which there is a YouTube video.

Link to a page where the issue can be seen:
Original page: hidden link
Translated page: hidden link
I expected to see: the video, not the YouTube address...

Instead, I got: only the YouTube address instead of the block

I need to translate independently and validate to solve the issue.

brave_jhijKXt7HA.jpg
OJlhsr8fHn.png
October 25, 2023 at 7:08 am #14657099

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

I checked the page, and the video works correctly in both languages. (Kindly check the attached screenshot)

Would you please let me know if the issue persists and how to reproduce it?

Best regards,
Osama

2023-10-25_10-06-30.jpg
October 25, 2023 at 7:31 am #14657389

T4ng

Hi.
It works now because I didn't want to leave that page broken, so that as explain, I basically edited the page individually to get it solved.
But I think the screenshots attached say it all: you can see what's wrong.
I'd rather not edit individually when I don't really need it.
Can you please try to replicate the issue on your side?

Thanks

October 25, 2023 at 7:43 am #14657505

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

I tried replicating the issue on a sandbox site, but it's not replicable. Please use this link to login to the sandbox. (hidden link)

Here is the page with the video, and it works correctly in all languages. (hidden link)

Please try to replicate the issue on the sandbox site and let me know how to reproduce it if it's replicable.

Best regards,
Osama

October 25, 2023 at 8:00 am #14657749

T4ng

OK, do you mind if we use the classic translation editor, since that's the one I'm using (and will keep using since it's much more convenient for what we do here) ?

October 25, 2023 at 8:02 am #14657759

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Please use the same editor and page builder on your site to replicate the issue.

Best regards,
Osama

October 25, 2023 at 8:16 am #14657953

T4ng

Indeed it works.
I switched to the classic translation editor, and made 2 tests.
1 with a YouTube video added, which I translate right after => Renders fine.
Then another one, with a caption on YouTube video. Works as well. So... I'm puzzled.

October 25, 2023 at 8:18 am #14657961

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Please run the following test on your site.

1- Create a new test page
2- Add a video
3- Translate the page

Kindly let me know if the new test page works correctly.

Best regards,
Osama

October 25, 2023 at 8:24 am #14658213

T4ng

As described, that's what I just did, twice.

October 25, 2023 at 8:26 am #14658225

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Could you please check if the issue persists in a minimal environment by following these steps?

1- Deactivate all the plugins except the active ones on the sandbox.
2- Switch to a WordPress default theme like Twenty Twenty-one.

If the issue is gone, activate them one by one to see which one is causing an interaction issue.

❌ Please backup your database before performing the above test ❌

Best regards,

October 31, 2023 at 8:33 am #14697325

T4ng

Hi, I'm still trying to replicate/isolate the issue, while deactivating plugins. Thanks for not closing this ticket.

October 31, 2023 at 8:36 am #14697335

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi,

Sure, please take your time. Kindly note that our system closes the ticket automatically after two weeks of inactivity, so please update us before this period.

Best regards,
Osama

November 1, 2023 at 7:05 pm #14710021

T4ng

Hi,
I think I've found the culprit.
After deactivating ALL the plugins, except very few required ones, and WPML's, then re-save the translation, nothing changed.
But as soon as I deactivate String Translation, and save the transation again (with changing anything, the problem disappears: the video actually comes back.
Then I double checked by retactivating ALL the plugins, then tested again with/without String Transation: same behavior. The video alway re-appears after deactivation WPML String Translation and save again the translation again, still from the Classic Editor.

7MbFwpbmOX.png
dSc4ogrApX.png
November 2, 2023 at 9:37 am #14714551

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hi there,

Osama is off today, so I am taking care of this ticket, hope that is OK. 🙂

String translation is needed for translation to work correctly and is a mandatory addon plugin for the WPML core. It should not cause any issues.

1) Please make sure to update WPML plugins to the latest versions (4.6.7 and 3.2.8). Then check if the issue still happens when using only WPML plugins and WP default theme, all others disabled.

2) If the issue still happens, please try again to replicate the same issue on the next test site that I setup.

- hidden link

Regards,
Drazen

November 2, 2023 at 11:02 am #14715533

T4ng

Here you are...
The problem occurs only AFTER the first translation.
On your test environment. I translated the content to ES a first time. No problem. Then I clicked "Save and Close".
Then clicked the pen again, as if I wanted to add some modifications.
I bacically clicked "Text", on both languages for the core/embed content, the copied the content of the original english, and pasted it in spanish. It was exactly the same anyway, since I didn't make any changes in the original page.

>> hidden link

firefox_XkY6ubbatg.png