Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 -

Supporter timezone: Europe/Vienna (GMT+02:00)

Tagged: 

This topic contains 1 reply, has 0 voices.

Last updated by Lucas Vidal de Andrade 6 days, 3 hours ago.

Assisted by: Lucas Vidal de Andrade.

Author Posts
October 8, 2025 at 7:14 pm #17468762

lauraR-37

Background of the issue:
I am trying to use a custom block with a video on my WordPress site, but the source is missing from the translation. The issue can be seen on this page: hidden link. I expected to see the video with the source included: <video muted="" autoplay="" loop="" class="absolute w-1/2 object-cover rounded-full top-1/2 -translate-y-1/2 aspect-square max-1/2 left-[-2%]"><source src="hidden link" type="video/mp4"></video>.

Symptoms:
Instead of the expected video with the source, I got: <video muted="" autoplay="" loop="" class="absolute w-1/2 object-cover rounded-full top-1/2 -translate-y-1/2 aspect-square max-1/2 left-[-2%]"></video>.

Questions:
Why is the video source missing from the translation?
How can I ensure the video source is included in the translation?

Here is my block code:
/**
* React hook that is used to mark the block wrapper element.
* It provides all the necessary props like the class name.
*
* @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops
*/
import { useBlockProps } from "@wordpress/block-editor";

/**
* The save function defines the way in which the different attributes should
* be combined into the final markup, which is then serialized by the block
* editor into `post_content`.
*
* @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save
*
* @return {Element} Element to render.
*/
import { InnerBlocks } from "@wordpress/block-editor";

export default function save({ attributes }) {

return (
<div
{...useBlockProps.save({ className: "relative min-h-[100px] alignfull aspect-[2/1] flex items-center overflow-hidden" })}
style={{
margin: `0 -${attributes.margin}px`,
width: `calc(100% + ${attributes.margin}px * 2)`,
padding: `0 ${attributes.margin}px`,
maxWidth: "unset !important",
}}
>
{attributes.imageUrl && (
<img
src={attributes.imageUrl}
alt="Coloron circle column image"
className={`absolute w-1/2 object-cover rounded-full top-1/2 -translate-y-1/2 aspect-square max-1/2 ${attributes.imageRight ? "left-[-2%]" : "right-[-2%]"}`}/>
)}
{attributes.videoUrl && (
<video
muted
autoPlay
loop
className={`absolute w-1/2 object-cover rounded-full top-1/2 -translate-y-1/2 aspect-square max-1/2 ${attributes.imageRight ? "left-[-2%]" : "right-[-2%]"}`}
>
<source src={attributes.videoUrl} type="video/mp4" />
</video>
)}
<div className={`absolute top-[10%] rounded-full w-[6%] aspect-square ${attributes.imageRight ? "left-[40%]" : "right-[40%]"}`}
style={{ backgroundColor: attributes.color }}></div>
<div
class="grid grid-cols-2 mx-auto"
style={{ maxWidth: "var(--wp--style--global--wide-size)" }}
>
<div
className={`col-span-1 py-24 ${attributes.imageRight ? "col-start-2 px-12" : "px-12"}`}
>
<InnerBlocks.Content />
</div>
</div>
</div>
);
}

October 9, 2025 at 12:13 pm #17471232

Lucas Vidal de Andrade
WPML Supporter since 11/2023

Languages: English (English )

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

Hey there,

If they're custom Gutenberg blocks, they need to be properly registered, so they're translatable. You can check details on how to do that here:

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

Please note that the creation and maintenance of custom code falls outside the scope of our support. If you are implementing custom solutions, you can check our documentation for developers as well:

https://wpml.org/documentation/support/

Finally, if the issue is specific to one or few pages, I recommend you just create the translations manually with the WordPress Editor, this way you don't need to alter any code or custom implementation. You just need to activate the option for the page, as explained:

https://wpml.org/documentation/translating-your-contents/using-different-translation-editors-for-different-pages/

Regards,