Currently, when adding Media through the CKEditor, there is no language selector.

Background: WetKit is now using entity translation.

We agreed that 95% of images won't require two images (one for English and one for French) because they won't contain overlayed text, the image needs to be able to be flagged as "Language Neutral" but allow for the ALT and Title fields of the image (or other media) to be translated.

And, in those 5% cases where the image contains overlayed text in one language, there needs to be a way to upload a second image with the overlayed text of the opposite language.

Comments

sylus’s picture

Status: Active » Needs review

I think everything is working properly for this after taking some time to think about it.

a) This is how Media + CKEditor works out of the box. The image is always language neutral, and the alt + title attributes can be edited per language.
b) Where you have an image that has localizable text on it. Just simply don't use that image for the translated content instead add a new image file entity completely.

I think this works. Unless something I am missing?

sylus’s picture

Status: Needs review » Postponed (maintainer needs more info)
sylus’s picture

Status: Postponed (maintainer needs more info) » Fixed

Moving this to fixed.

jayson’s picture

Status: Fixed » Closed (works as designed)

Ok, I was able to translate a node with an image and get the Title and ALT tags translated. It does work as designed.

Thanks!

rob_johnston’s picture

Version: 7.x-1.0-rc13 » 7.x-1.0-rc24
Category: Feature request » Support request
Issue summary: View changes
Status: Closed (works as designed) » Active

I have the exact same question as the OP, but does the explanation given in #1 imply that there can never be a translation set of media?

One obvious case of this would be the "Priorities" section on GC home pages that shows images with text in either English or French. Another would be the video currently on the WetKit homepage (if a translation existed). Others would be uploaded PDF files.

I'm thinking about enabling the media_translation module for this. Anybody have anything to say about that idea or am I going down the wrong path here?

sylus’s picture

Yeah I think this issue needs to have a bit more thought of the workflow for this.

I am under the impression this should be solved natively with media + entity translaiton without the need media_translation. Also the media_translation module is a year old and I would highly doubt would work with media + file entity as it is now though could be wrong. Can you not just create a seperate image entity for english and french?

I'd like to take a day to consult with a few people and will post back what I find but first can you give a specific use case that isn't being met?

Maybe we could make a list of all the ways we envision file entities + media to work and cross them all off after we discuss them.

It is my feeling that everything is working as expected but definitely could be wrong or have missed something.

As always thanks for moving these issues forward and encouraging further discussion.

rob_johnston’s picture

OK, re-reading the thread I see one difference is that the OP was using an image in the body and I'm dealing with the primary image. But thinking ahead, could you do a video translation for the bean on the home page (the entity translation values in the DB suggests that it hasn't been done yet)? Is there value to having translation sets of media so missing translations can be quickly identified? Could a media translation be flagged as out of date like nodes are? Just thinking out loud here.

I originally bumped into this problem when migrating data into the WetKit. I've found over 60 instances when the primary image on a page was different in English and French. Most all of these were due to overlaid text on the image. Like the OP said, it's only a small percentage.

The migration worked almost perfectly in that it put both files in the file system, the alt text and title text and entity translations were all correct in the database except I ended up with the uri field in the file_managed table overwritten with the French. So what this means is that when I went to /admin/content/file I saw the French image on the English page. So close!

I then tried to do it manually (upload a file and translate it from /admin/content/file) to see how the DB gets filled, and thereby avoiding the field_featured_image file (which doesn't have translation enabled). But I noticed that if I changed the image on the French page then it replaced the English. That's when I remembered this issue (I read them all). So it didn't work this way either, and now here we are.

sylus’s picture

Category: Support request » Bug report

Ah okay I completely get the problem now this is clearly something to address.

Lets mark this as a bug.

sylus’s picture

joseph.olstad’s picture

I looked up that related issue https://drupal.org/node/1470018, the maintainer marked it as fixed October 6, 2012 at 10:38pm for 7.x-2.x-dev.
It looks to me that this fix was merged over a year ago in 7.x-2.x-dev in the media module.

We are currently using a recent version of 7.x-2.x-dev. Has anyone confirmed this to be still an issue?

sylus’s picture

Category: Bug report » Support request
Status: Active » Postponed (maintainer needs more info)

Okay I looked at this. I think the only solution is to turn field_featured_image into a translatable field. However at this point the alt + title fields will then only be associated to that specific image. So you would have 4 field attached, 2 for each language.

So in your content type if you have to support images with text on it you would have to turn the translatable field on. Does this make sense? Honestly I haven't looked too deep into this but this is the assumption we are going with.

I think it was also mentioned that text in images is not accessible so should be avoided where possible.

Does setting the translatability of the field fix your problem?

rob_johnston’s picture

So to enable translation, one would go to "Structure | Content types | Basic Page | Manage Fields | Primary Image", scroll to the bottom, and click "Enable translation". No?

Done that and not quite. The alt and title text are translatable but not the image... it says "Remplacer le fichier (toutes les langues)" and replaces the English, as advertized. Coming at it from "Content| Files" also shows the "Translate" link but does the same.

I agree with the accessibility issue about images with text on them, but unfortunately they exist. And other media files would more legitimately have translations, such as videos, transcripts, and PDFs.

sylus’s picture

Yeah this is weird because file type is based on the file itself so hard to associate an additional file to the same set of fields.

Oddly enough this is solved by wetkit media + slideshow as they used field collections which themselves allow for translatable fields.

Looking further into this.

sylus’s picture

Re: #12.

Steps to Reproduce:

a) I enabled translation with: "Structure | Content types | Basic Page | Manage Fields | Primary Image"
b) Went to Drupal Platform Page and edited the french image by removing it and linking to a new image + alt
c) When to Drupal Platform (EN) and image was different with english alt
d) When to Drupal Platform (FR) and image was different with french alt

Is this the behaviour your not receiving?

rob_johnston’s picture

When I follow those steps, yes it did work. I tested it by creating a brand new piece of content... I'll look at it a bit more. I might have done something weird or there's an order of operations different.

rob_johnston’s picture

OK, I tried it again. I modified instead of deleted the image and that got me to the other pop-up screen that has the link on the top right "Ajouter la traduction French". Your method works, but it's a pitty that files can't be made translations of each other under "Content | Files". Wanna mark this as resolved or does the "Ajouter la traduction French" peak your interest?

sylus’s picture

I am inclined to keep this issue open and add it to known issues so a proper workflow can be established or at least make sure nothing missing.

sylus’s picture

Status: Postponed (maintainer needs more info) » Needs work
rob_johnston’s picture

OK then, back to my migration problem.
Another related issue: #1418644: Add multilingual support for files?

rob_johnston’s picture

Just want to note that when this approach is taken, all the images are recorded as English images. The effect of the above procedure is that the "language" column of the field_data_field_featured_image changes from "und" to either "en" or "fr", but the same column for the field_data_field_file_image_alt_text and field_data_field_file_image_title_text tables both stay as English.

The output below is a bit hard to read but can be copy-and-pasted into a text editor that doesn't wrap.

wetkit_db=> SELECT * FROM field_data_field_file_image_alt_text;
 entity_type | bundle | deleted | entity_id | revision_id | language | delta |    field_file_image_alt_text_value    | field_file_image_alt_text_format
-------------+--------+---------+-----------+-------------+----------+-------+---------------------------------------+----------------------------------
 file        | image  |       0 |         1 |           1 | en       |     0 | Web Experience Toolkit Logo           | plain_text
 file        | image  |       0 |         2 |           2 | en       |     0 | Drupal Trademark Logo                 | plain_text
 file        | image  |       0 |         3 |           3 | en       |     0 | Photo of people holding hands         | plain_text
 file        | image  |       0 |         1 |           1 | fr       |     0 | Boîte à outils de expérience Web Logo | plain_text
 file        | image  |       0 |         1 |           1 | und      |     0 | Boîte à outils de expérience Web Logo |
 file        | image  |       0 |         2 |           2 | fr       |     0 | Drupal logo de la marque              | plain_text
 file        | image  |       0 |         2 |           2 | und      |     0 | Drupal logo de la marque              |
 file        | image  |       0 |         3 |           3 | fr       |     0 | Photo de personnes se tenant la main  | plain_text
 file        | image  |       0 |         3 |           3 | und      |     0 | Photo de personnes se tenant la main  |
 file        | image  |       0 |         5 |           5 | en       |     0 | BoC EN alt text here                  |
 file        | image  |       0 |         6 |           6 | en       |     0 | BoC FR alt text here                  |
(11 rows)

wetkit_db=> SELECT * FROM field_data_field_file_image_title_text;
 entity_type | bundle | deleted | entity_id | revision_id | language | delta | field_file_image_title_text_value | field_file_image_title_text_format
-------------+--------+---------+-----------+-------------+----------+-------+-----------------------------------+------------------------------------
 file        | image  |       0 |         5 |           5 | en       |     0 | BoC EN title text here            |
 file        | image  |       0 |         6 |           6 | en       |     0 | BoC FR title text here            |
(2 rows)

wetkit_db=> SELECT * FROM field_data_field_featured_image;
 entity_type |   bundle    | deleted | entity_id | revision_id | language | delta | field_featured_image_fid |   field_featured_image_alt    | field_featured_image_title | field_featured_image_width | field_featured_image_height
-------------+-------------+---------+-----------+-------------+----------+-------+--------------------------+-------------------------------+----------------------------+----------------------------+-----------------------------
 node        | wetkit_page |       0 |         2 |           5 | en       |     0 |                        2 | Drupal Trademark Logo         |                            |                        500 |                         140
 node        | wetkit_page |       0 |         2 |           5 | fr       |     0 |                        2 | Drupal Trademark Logo         |                            |                        500 |                         140
 node        | wetkit_page |       0 |         3 |           6 | en       |     0 |                        3 | Photo of people holding hands |                            |                        410 |                         240
 node        | wetkit_page |       0 |         3 |           6 | fr       |     0 |                        3 | Photo of people holding hands |                            |                        410 |                         240
 node        | wetkit_page |       0 |         4 |          10 | en       |     0 |                        5 | BoC EN alt text here          | BoC EN title text here     |                        570 |                         350
 node        | wetkit_page |       0 |         4 |          10 | fr       |     0 |                        6 | BoC FR alt text here          | BoC FR title text here     |                        570 |                         350
(6 rows)

One would then have to "Content | Files" to manually change the language of the files to French for the database to match reality. Still seems to me that it's 90% there, but not quite.

sylus’s picture

Status: Needs work » Closed (won't fix)

I am going to close this issue as hasn't moved and was more of a support request that should be geared towards the media module itself.

If anyone wants this issue to proceed I would create an 'succint' issue in the media queue and reference back to this issue.