| Project: | Media |
| Version: | 7.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
When I edit a node with a translated file (image) and I click on Edit Media, I expect to be able to edit the translated version of that entity, not the original.
- I've a content type Article with a Dutch translation.
- I've enable translations for the entity File and created a Dutch translation for a specific image
- While in the English interface, I've added the image to a node.
- When I switch the interface to Dutch I see the translated node and even the translated image beloning to the node
- When I EDIT the node, I have a button 'Edit media' (see screenshot). This opens a modal frame with a form to edit the image. This form however, shows the english version of the image. Not the Dutch version, as I expected.
See screenshot.

| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| Schermafbeelding 2012-03-06 om 09.12.31.png | 32.56 KB | Ignored: Check issue status. | None | None |
Comments
#1
Subscribe,
I`have the same issue on file entities. I have an image file entities with some attached fields in french (I use Media with entity translation). when I add an image and translate it to english, all go well. but if I want to edit the translation, the edit form display the source entity that in french ?
#2
This should be fixed once #1282018: Improve UX of language-aware entity forms is committed.
#3
Does not work properly yet. Let's fix this.
#4
We need better integration with the Media project.
#5
Related issue: #1418076: Allow for multiple base paths.
#6
[double post removed]
#7
Attached patch (against media-7.x-2.x) adds ET support for the media edit modal popup, with the multiple-paths patch in #1418076-18: Allow for multiple base paths... We should probably open a new issue in the media issue queue once the multiple path issue is resolved.
#8
The attached patch adds ET integration for the Media modal popup (requires #1418644-7: Add multilingual support for files and #1418076-22: Allow for multiple base paths).
#9
Better UX: now the link to create a translation uses the canonical local action theming. Moreover now it is possible to create a translation only in if it is missing the current content language. This way context is always kept and pressing the 'Edit media' button allows to edit the values for the current language or create a translation for the current language. Full administration of translations is still available at
file/%file/translate.#10
Ahem
#11
Minor fix.
#12
This and #1418644: Add multilingual support for files are the last blockers for the first Entity Translation beta. It would be great to have some feedback ASAP :)
#13
Awesome, patch #11 works very well and makes translating media files soooo much easier! :)
I only have two questions/issues and think it's RTBC otherwise:
+++ b/includes/MediaEntityTranslationHandler.inc@@ -0,0 +1,54 @@
+ if (isset($form['actions']['delete_translation'])) {
+ $form['actions']['delete_translation']['#weight'] = 10;
+ }
This is only for the "file/x/edit" pages, right? For the media path scheme it doesn't do anything because the "delete translation" action is removed anyway... So does this belong into media or should it be in file_entity?
+++ b/includes/MediaEntityTranslationHandler.inc@@ -0,0 +1,54 @@
+ $form['media_add_translation'] = array(
+ '#weight' => -110,
+ '#markup' => '<ul class="action-links"><li>' . $link . '</li></ul>',
+ );
Can we reuse some existing theming function for this?
#14
Nice catch :) This actually would belong to File Entity, but I thought it didn't make sense to introduce a
FileEntityTranslationHandlerjust for those two lines. Do you think it's worth?I wasn't able to find a proper theming function. See Bartik's page.tpl.php.
#15
No, I guess not. Let's leave it in here for now. (Unless media module maintainers object?)
Hm, looks like there's no theming function for the list then, but we can use 'menu_local_action' for the link... patch updated.
#16
Works for me.
#17
Updated the patch for the change introduced in #1799770: Update id and bundle when setting a wrapped entity (removed
$entity_idfrom handler constructor).#18
That was the last serious API change for Entity Translation before beta1. You can commit #17 safely, if you are happy with it.
#19
I am happy with it, thought at first that this should be in file entity module, but i see this is about media path.
thanks both
#20
Automatically closed -- issue fixed for 2 weeks with no activity.