# Embedded video with translations

**URL:** <https://forum.builder.io/t/embedded-video-with-translations/5698>\
**Category:** Technical Questions\
**Created:** [May 29, 2024, 2:02pm UTC](https://forum.builder.io/t/embedded-video-with-translations/5698 "2024-05-29T14:02:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![maythee](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@maythee](https://forum.builder.io/u/maythee)\
**Post date:** [May 29, 2024, 2:02pm UTC](https://forum.builder.io/t/embedded-video-with-translations/5698/1 "2024-05-29T14:02:19Z")

</div>

Hi, we have a problem adding embedded video when we want to use different video for different languages. When we add link for languages other than English, the text shows in Embedded box “Invalid URL”

 ![Screenshot 2024-05-29 at 16.00.30](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/9/987c8f3e85a193d2e94361e471e3930c6dfcea27.png)

Anyway to use a different link for this embedded video?

**Builder content link**

> **[Builder.io: Visual Development Platform](https://builder.io/content/88e31fad6dae4017b2e359e52210ce36/edit?activeDesignerTab=0&selectedBlock=builder-8890267ad8d34df9bb00251be76050cf&activeLocale=de)**
>
> Drag and drop with your components, right within your existing site or app. Build and optimize digital experiences for any tech stack, visually..

---

<div class="post-metadata">

**Author:** ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)\
**Post date:** [May 29, 2024, 3:26pm UTC](https://forum.builder.io/t/embedded-video-with-translations/5698/2 "2024-05-29T15:26:39Z")

</div>

Hello @maythee,

Could you share a video link which is giving the error “Invalid URL”?

---

<div class="post-metadata">

**Author:** ![maythee](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@maythee](https://forum.builder.io/u/maythee)\
**Post date:** [May 30, 2024, 7:31am UTC](https://forum.builder.io/t/embedded-video-with-translations/5698/3 "2024-05-30T07:31:03Z")

</div>

Any youtube video links e.g. [https://www.youtube.com/watch?v=hiY\_HtuX4gY](https://www.youtube.com/watch?v=hiY_HtuX4gY) and [https://www.youtube.com/watch?v=Zh0tdlD7CtU](https://www.youtube.com/watch?v=Zh0tdlD7CtU)

After add the link to the translation, the component update the content to show “Invalid url, please try another” but if I remove the translation, the component will show the video.

---

<div class="post-metadata">

**Author:** ![maythee](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@maythee](https://forum.builder.io/u/maythee)\
**Post date:** [May 30, 2024, 7:31am UTC](https://forum.builder.io/t/embedded-video-with-translations/5698/4 "2024-05-30T07:31:36Z")

</div>

Here is another content link I use to test [Builder.io: Visual Development Platform](https://builder.io/content/43a0736e47d7456e899f2b845054c9b0/edit?activeDesignerTab=0&selectedBlock=builder-fe5f69fce914467f8bb92312ed46ab59&activeLocale=de)

---

<div class="post-metadata">

**Author:** ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)\
**Post date:** [May 30, 2024, 8:49am UTC](https://forum.builder.io/t/embedded-video-with-translations/5698/5 "2024-05-30T08:49:08Z")

</div>

Hello @maythee,

We have identified the issue with the embed block localized URL on our end. It seems to be a bug or an oversight, as the localized URL feature is relatively new. I have brought this to the attention of our team for further discussion, and we will keep you updated on any progress.

In the meantime, you may want to consider creating a custom component or using data binding to update the URL based on the `state.locale`.

 ![Screenshot 2024-05-30 at 2.18.26 PM](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/3/357355be147370e245a3ad5fe8a46c45bffa8083.jpeg)

---

<div class="post-metadata">

**Author:** ![maythee](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@maythee](https://forum.builder.io/u/maythee)\
**Post date:** [May 30, 2024, 9:08am UTC](https://forum.builder.io/t/embedded-video-with-translations/5698/6 "2024-05-30T09:08:57Z")

</div>

I tried the data biding with code that you provided but it doesn’t seem to work when I change locale to `es`.

---

<div class="post-metadata">

**Author:** ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)\
**Post date:** [May 30, 2024, 11:22am UTC](https://forum.builder.io/t/embedded-video-with-translations/5698/7 "2024-05-30T11:22:02Z")

</div>

Hello @maythee,

Here is the code for binding that seems to be working for us

```auto
let url = "";
if(state.locale === 'es'){
  url = "https://www.youtube.com/watch?v=Zh0tdlD7CtU";
}else if(state.locale === 'fr'){
  url = "https://www.youtube.com/watch?v=hiY_HtuX4gY";
} else {
  url = " https://www.youtube.com/watch?v=hiY_HtuX4gY";
}

export default url;

```

Update the code according and let us know if you have any further questions.

Thanks,

---

<div class="post-metadata">

**Author:** ![maythee](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@maythee](https://forum.builder.io/u/maythee)\
**Post date:** [May 30, 2024, 11:59am UTC](https://forum.builder.io/t/embedded-video-with-translations/5698/8 "2024-05-30T11:59:29Z")

</div>

I updated the content to be localised value and it seems to work for us now.

```auto
 "component": {
    "name": "Embed",
    "options": {
      "content": {
        "@type": "@builder.io/core:LocalizedValue",
        "Default": "<div style=\"left: 0; width: 100%; height: 0; position: relative; padding-bottom: 56.25%;\"><iframe src=\"https://www.youtube.com/embed/en?rel=0\" style=\"top: 0; left: 0; width: 100%; height: 100%; position: absolute; border: 0;\" allowfullscreen scrolling=\"no\" allow=\"accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share;\"></iframe></div>",
        "en": "<div style=\"left: 0; width: 100%; height: 0; position: relative; padding-bottom: 56.25%;\"><iframe src=\"https://www.youtube.com/embed/en?rel=0\" style=\"top: 0; left: 0; width: 100%; height: 100%; position: absolute; border: 0;\" allowfullscreen scrolling=\"no\" allow=\"accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share;\"></iframe></div>",
        "de": "<div style=\"left: 0; width: 100%; height: 0; position: relative; padding-bottom: 56.25%;\"><iframe src=\"https://www.youtube.com/embed/de?rel=0\" style=\"top: 0; left: 0; width: 100%; height: 100%; position: absolute; border: 0;\" allowfullscreen scrolling=\"no\" allow=\"accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share;\"></iframe></div>"
      },
      "url": {
        "@type": "@builder.io/core:LocalizedValue",
        "Default": "https://www.youtube.com/watch?v=en",
        "en": "https://www.youtube.com/watch?v=en",
        "de": "https://www.youtube.com/watch?v=de"
      }
    }
  },

```

So this is solved for us as a moment instead of using script. However, any update related to the component fixing this localisation please let me know.

---

<div class="post-metadata">

**Author:** ![Stephane](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Stephane](https://forum.builder.io/u/Stephane)\
**Post date:** [August 23, 2024, 2:35pm UTC](https://forum.builder.io/t/embedded-video-with-translations/5698/9 "2024-08-23T14:35:19Z")

</div>

Hi @maythee - I am pleased to confirm that our engineering team has fixed the reported issue.
