Score:0

Translation of a video URL

eg flag

I have a content type Book with a field called demo that references to a media (remote video - we must provide a youtube URL). As a first step I create a new node in french and I put a youtube URL ex: www.youtube.com/abc and I save. then I add a new translation to english and I put another youtube URL for this demo field ex: www.youtube.com/zyx. Now when I go back to the firstly created node in french, I see that the video that is displayed is the one whose URL is /zyx instead of /abc ! Any idea why? PS: the field is listed as translatable here : /fr/admin/config/regional/content-language

Score:1
ru flag

You translated the wrong part. Your node has a reference field to a media. This field must not be translatable, it will always reference the same media ID.

Instead enable translation for the media entity, and the remote video source URL field.

Translate the media. Translate the node (e.g. title, but not the media reference). Done.

At the end you have got one node with two translations, one video media with one ID and two translations. Both node translations point to the same the media ID, and Drupal will automatically pick the correct translation for the video.

Mira chalak avatar
eg flag
Thank You so much ! and if there is no translation, so for example if for a certain node i want the video /abc to appear for all languages , then I don't add any translation to the media and by default for all languages the video abc will apear correct ?
ru flag
Yes, untranslated references will fallack to the original language.
Mira chalak avatar
eg flag
Thank You sooo much !
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.