Skip Navigation

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

Problem:

Can't translate video source (WPML / Stackable Gutenberg blocks)

Solution:

Please the following code to WPML-> Settings-> Custom XML Tab

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="stackable/video-popup" translate="1">
      <key name="videoLink"></key>
      <xpath type="link">//div/@data-video</xpath>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

After that, update the page in the default language and its translation.

<strong>Relevant Documentation:</strong>
https://wpml.org/documentation/support/language-configuration-files/

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 5 replies, has 2 voices.

Last updated by sylvieH-3 1 year, 8 months ago.

Assisted by: Osama Mersal.

Author Posts
May 5, 2023 at 9:34 am #13592709

sylvieH-3

Hi,

I installed a plugin to have more Gutenberg blocks (https://wordpress.org/plugins/stackable-ultimate-gutenberg-blocks/).

I use only the "popup video" block from this plugin.

When I put the block on a page, I can choose a video to display (when the play button is clicked).

But I want it to show another video (change the src value of the video tag only) when I'm on a translated page.

When I use this snippet in my WPML config, I see the video source field in the translation editor and can translate it fine. But this doesn't seem to impact the front-end: on both pages (the original and the translated one) the same video source is used.

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="stackable/video-popup" translate="1">
      <key name="videoLink">
      </key>
<key name="data-video" />
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

What could be the issue here?

Is there any way to "force" the URL change so it works?

Thanks in advance for your help!

May 7, 2023 at 7:34 am #13599823

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.

1) Could you please try the following XML?

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="stackable/video-popup" translate="1">
      <key name="videoLink" />
      <xpath type="link">//div/data-video</xpath>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

2) Could you please share your Debug information with me?
You can read a detailed explanation about it here. (http://wpml.org/faq/provide-debug-information-faster-support)
The debug info will give me a lot of information about how your site is configured.

Best regards,
Osama

May 9, 2023 at 7:57 am #13610593

sylvieH-3

Hi,

Thanks for your answer. Your updated code still doesn't seem to be working unfortunately.

My bad, I've attached debug info to this ticket now.

Thanks 🙂

May 9, 2023 at 8:11 am #13610955

Osama Mersal
Supporter

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

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

Hi,

Thanks for your update. I've consulted our compatibility team regarding this issue and will update you as soon as I get their reply.

Best regards,
Osama

May 9, 2023 at 4:08 pm #13615771

Osama Mersal
Supporter

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

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

Hi,

Please try the following XML code.

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="stackable/video-popup" translate="1">
      <key name="videoLink" />
      <xpath type="link">//div/@data-video</xpath>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

I tested it on the sandbox, and it works correctly. (hidden link)

I hope this helps you. If you need further info, please let me know.

Best regards,
Osama

May 10, 2023 at 8:16 am #13619381

sylvieH-3

Thanks, this snippet works just fine!

Have a nice day 🙂