I'm using media 2 module and files entites with fields added on some type of entities.
Entity translation just work fine to translate any fields I added in my file entities but I want to translate the file itself (or in fact, having a different PDF file for each language versions in a same file entity) but that seem not possible : build-in fields that handle 'file' and 'file name' can't be set as translatable fields : I can't access these fields settings so I'm not able to reach the Field 'translation' settings.

I guess is it sort of the same problem that with the 'title' field in nodes (for which a solution exists : https://drupal.org/project/title) but is there a solution for my issue ?

Thanks in advance

Comments

sylvain lavielle’s picture

Issue summary: View changes

Nobody can tell me more about this issue ?

rerooting’s picture

Have you enabled entity translation for file entities in the entity translation UI?

Andrew Edwards’s picture

I have the same issue. Most fields on a file entity can be translated, however the file field cannot be translated.

Examples:

1) Say I upload an English video with an English title in the title field. I can add a Spanish title using entity translate but I can't add a Spanish video. I'd like to because the original video has language specific content.

2) A client wants to upload their annual report as a pdf in 2 different languages. At the moment they couldn't do this within 1 file entity as the media field doesn't offer translation.

Questions/thoughts:

1) Is this actually a Media module issue? After all it's a Media field that doesn't have the feature.
2) Are there ways around the problem? Perhaps, for example, all we need to do is have separate file entities for each language a file is in. I can see this being a problem on a file page. Say there was a page for an english language video; if the site visitor switched language on that page then the English video would still display. We could perhaps show links to other language videos via entity reference. Bit of a hack though.

Andrew Edwards’s picture

Hmm my mistake: Actually it's not a Media field. I'm not sure what it is :(

sylvain lavielle’s picture

Hi Andrew,

I didn't get manage to find a direct solution to this problem. I think the file is in fact THE entity itself so you could not change file for another translated version of the file because an other version of the file is another entity :) (I hope here make myself clear but I'm not quite sure).

To do what I wanted to, I had to use the old way : Create a node with my entity file linked as a field and then I had a node with a field which could have one file by language.

And no it was is not intellectually satisfying but it worked nicely.

Andrew Edwards’s picture

Thanks for replying Sylvain!

I think you're totally right about the file being THE entity. I guess it represents an actual file, so it would be a bit odd to switch in another one.

I'm to have a go at doing it the old way as well. I've found this module: https://www.drupal.org/project/media_translation which does it that way. It's not well maintained though, so I think I'll have a bit of work to do!

Andrew

sylvain lavielle’s picture

I tried this one too,

As fas as i remember it doesn't fit my need, especially because i've not been able to make it switching to the good media language version corresponding to the current drupal language.

Good luck, though. let me now if you find out somthing better than what i did.

Back to the issue, it's kind of logical indeed on my developper's point of view, though the drupal user in me says it's lame :)

enorniel’s picture

I am also very interested by that feature.

Did you make any progress ?

Thanks.

Andrew Edwards’s picture

Hi enorniel,

In the end I ended up not linking the file translations at all. If a page is in say English editors pull in English files for display, If in French, editors pull in French files. The different translations of a file are not linked at all. It does mean a bit more work for editors, but it's the best I could come up with.

As discussed above I don't think it makes sense to have different translations of a file on a file entity, because a file entity represents a single file.

enorniel’s picture

Thanks. But I should disagree on your conclusion.

There are some cases where a file should be completely translated in the same entity to be more efficiently processed by other mechanisms.

For instance, if a user wants to see the last Marvel: Avengers 2 on video stream website based on Drupal (officially of course), he wants certainly see it in his own language. He will use the search_api to look for it in the catalog. Maybe, that video will be spotlighted, its tags changed to display a promotional tag...

If the catalog has 10000 and more videos and the website is translated in 50 languages, just imagine how to manage that if a video is 50 bundles.

Andrew Edwards’s picture

I know where you're coming from. But I still think file entity represents individual files.
For example (with file entity representing individual files), if you had a language field on file entity you could 'tag' each file with a language.
If you had multiple files within a file entity how would you do that? You would only have one language field. Would you create another entity for each file?
What I've done in another project, and I think what Sylvian did, was create another entity that can take multiple files. For example a Movie entity that you can attach multiple file entities to.

Do let me know if you find a better solution though! It'd be great if there was one.

Oboklob’s picture

I'm going to add a vote for translatable files, because I have exactly the issue where I am forced into a messy solution of creating a node wrapper in order to do this:
I want to have views (or search results) of media entities, but in some cases e.g. videos, these need to be in the user's language. I can't just add a language field, as not every file has a translation for every language and there would therefore not be the nice functionality of falling back to a default language where no translation exists - for example having a movie trailer in Spanish and English, I would want to show the English trailer for other languages - not to mention the loveliness of having a translate interface rather than uploading all the videos as separate items.

I agree in many projects a file entity should be a specific file. But if file entity was capable of translating the file field the choice would then be down to the developer for what is best for a project.

icicleking’s picture

I'm using mediaelement.js to display videos. I'm constructing the video using multiple files, including closed caption files, mrt and webm videos, and chapter markers. I'm putting them together at the theme level with a custom node template. Not being able to translate the file means I have to add translation logic into the template, ugh. I'm beginning to regret moving to entity translation instead of content translation. -- edit, oh, I just found the button to translate the field. It was toward the bottom of the field edit page.