We have alt and title fields now (https://drupal.org/node/1307054)

But they are language neutral, the same text is shown on all languages.

#15 interdiff-10-15.txt1.47 KBidebr
#15 media-popup_translations-2017647-15.patch5.19 KBidebr
PASSED: [[SimpleTest]]: [MySQL] 1,095 pass(es).
[ View ]
#10 media-popup_translations-2017647-10.patch4.36 KBLeksat
PASSED: [[SimpleTest]]: [MySQL] 922 pass(es).
[ View ]
#4 Screen Shot 2013-06-25 at 10.35.07 AM.png102.93 KBmgifford


rob_johnston’s picture

I think this is related: #1470018: Provide Entity Translation integration. Still working through this myself.

mgifford’s picture

Ok, so that issue for Entity Translation was fixed in October, but I think this is still a problem with at least the released version of Media.

@rob_johnston did you get it working?

rob_johnston’s picture

That issue gave me some clues as to what to expect and let me try to list them here (hope I don't skip a step):

  1. I went to /admin/config/regional/entity_translation and under "Translatable entity types" I enabled "File".
  2. On the same page, for the "File" type I now have the "Image" set to default to the current language and to exclude language neutral (my preference).
  3. I then went to /admin/structure/file-types and for the "Image" type, under "Manage fields", I edited the "Alt Text" and "Title Text" and clicked "Enable translation" at the bottom.
  4. I then edited the content type and synchronized the image field across translations

So when I do that, after creating the content in English, saving, and creating the translation in French, I click the edit button for the image. I then see a new button up on the top left (easy to miss) that says "Add French translation" and a drop-down that indicated that I'm currently editing the English version. This is the clue that I got from the referenced issue. This form that pops-up is very similar to the full file edit form (e.g. if I know my file is saved as number 1234 then I could go to /file/1234/edit).

So, does this work for anybody else? Non-intuitive, I'd say, and I think that this pop-up form should be in the current language so the "Add French translation" button could disappear. It's an extra step that would be easy for a user to forget to do.

mgifford’s picture

new102.93 KB

I'm trying to replicate this, but having trouble. I've got the alt text translation enabled here:

But I'm also using the media module so that might be messing things up. When I edit an image here:

I don't see anything that allows me to edit the image.

In step 4 when I edit an image I'm not seeing anything for the translation:

Screen Shot of Media module pop-up

But ya, definitely not intuitive.

rob_johnston’s picture

It's possible that I forgot a step, but I can't think what it might be.

When you go to edit an individual file from the /admin/content/file/edit-multiple page, do you get the "Translate" link on the top-right of the screen?

It wasn't until I synchronized the image field between translations that I saw the "Add French translation" button appear on the top left of that pop-up form that you attached. If the image has a different file number in both languages then the button doesn't appear. If you were to add a line to the "entity_translation" table where entity_type=file, entity_id=34, language=fr, source=en, status=1, and translate=0, etc, would you then see the button?

supermoos’s picture

Did any of you find a way to enable alt and title translations? I have enabled the alt & title fields as translatable under the file types. And under /admin/config/regional/entity_translation, I've also tried both enabling and disabling field translation of the image field on my content type - seems to make no difference. The only thing that seems weird is that under my node content type edit form and the "Synchronize translations"-tab, no fields are available for synchronization?

davidk2’s picture

re: #3 rob_johnston - it works for me. Both fields (alt + title) are translated now, but title + alt atributes in HTML code has still only one language in all translated entities/images.

pikku-h’s picture

Im not sure if this should be separate issue, but the same thing happens without translations:

  1. Node 1 has image with title "Title 1"
  2. Create Node 2, pick (the same image as in Node 1) image from library and set image title to "Title 2"
  3. Node 1 image title is now "Title 2"
mgifford’s picture

Issue summary:View changes
Issue tags:+accessibility, +i18n
Leksat’s picture

Version:7.x-2.0-unstable7» 7.x-2.0-alpha4
Status:Active» Needs review
new4.36 KB
PASSED: [[SimpleTest]]: [MySQL] 922 pass(es).
[ View ]

Here is a patch providing basic support for entity translation. I've tested in only with media field.

The translation support works only if both parent entity and file entity are managed by entity_translation module.

The file entity translation handler in the media popup form inherits form/source language from the parent entity translation handler when it's possible.

I've made the patch on the base of 7.x-2.0-alpha4 because latest 7.x-2.x (3fc13e9) does not work for me at all.

J-Lee’s picture

Patch #10 is working for me (7.x-2.0-alpha4). Thank you Leksat!

Edit: If you use fields for alt and title text:
I noticed that the file/image default language should set to "current language" at the entity translation settings. If not, alt and title text won't shown after uploading new imagesbecause they are in a wrong language.

Sebbon’s picture

Patch works on alpha4. It does not give me a language/translation switcher button in the mediabrowser popup when editing a image in a node. However, if I switch to the other language during editing of the node (using the language switch of the node) and then open the image file media browser with the edit button I see the translatable fields for Alt and Title. Works like a charm.

Drupal 7.36
Media 7.x-2.0-alpha4+37-dev

Ahmad Abbad’s picture

Patch #10 is working for me (7.x-2.0-alpha4).

FiNeX’s picture

Im' using the latest -dev version ( 2015-Jun-30 ) and the parent entity is translated using i18n (not entity translation).

The file entity is translatable: on file/edit/ID the "translate" tab is visible and it works fine (switching the language the alt/tab attributes are correctly loaded) but the media browser popup always loads the file entity using the default language and it doesn't show the translation switcher.

idebr’s picture

Version:7.x-2.0-alpha4» 7.x-2.x-dev
new5.19 KB
PASSED: [[SimpleTest]]: [MySQL] 1,095 pass(es).
[ View ]
new1.47 KB

I updated the patch with the use case from #14