Here's a patch adding support for the entity_translation.

Also fixes the $entity in hook_field_formatter_view() which got reassigned on for each target entity.

CommentFileSizeAuthor
#5 support_entity_translation-2364113-5.patch1.78 KBAnonymous (not verified)
#1 support_entity_translation-2364113-1.patch1.49 KBAnonymous (not verified)

Comments

Anonymous’s picture

StatusFileSize
new1.49 KB
Anonymous’s picture

Status: Active » Needs review

The 'entityreference_label' formatter is OK because the label is already in the proper language, only 'entityreference_entity_view' needs to be patched.

kitikonti’s picture

Tried this on the latest stable and got this:

Fatal error: Call to undefined function entity_translation_get_existing_language() in /var/www/masterhomes_dev/sites/all/modules/entityreference/entityreference.module on line 1272

I dont think that this missing function exists in the latest dev.

kitikonti’s picture

Status: Needs review » Needs work
Anonymous’s picture

StatusFileSize
new1.78 KB

Looks like the function exists only in a "recent" version of the code. #2073231: Rename entity_translation_form_language() to entity_translation_get_existing_language()

And this time I've tested with all versions of entity_translation: 7.x-1.0-beta3, latest 7.x-1.x-dev and the code from the repository.

Anonymous’s picture

Status: Needs work » Needs review
kitikonti’s picture

@SchnWalter could you confirm that this is a duplicate to the referenced issue? because in my case the patch from the referenced issue fixed my problem. so we could close this issue as a duplicate.

Anonymous’s picture

No, this is not a duplicate.

This patch is for setups where you have one entity with fields in multiple languages. Where the nodes/entities have "Multilingual support" set to "Enabled, with field translation", exposed by "Entity Translation".

The patch #45 seems to tackle the old case when "Multilingual support" is set to "Enabled, with translation" exposed by the core translation module and extended by i18n*. In this setup you will have completely different entities for each language and just a mapping between them.

So, for full internationalization support both patches should go in.

kitikonti’s picture

I disagree, i am currently working on a project with exactly the same approach like you describe. I have two content types, both with "Enabled, with field translation". I have a entity reference field from content type A to B. This field is not translateble (maybe this is the difference between our two setups). In my case the reference target node is always the same, language independent. My only problem was that if i view a node of content type A, and i set the field formatter from the reference field to "Rendered Entity", The referenced node of content type B was not in the current sites language. But this was fixed with the patch of the reference Issue.

Anonymous’s picture

Issue summary: View changes
Anonymous’s picture

Status: Needs review » Closed (duplicate)

I've tested #45 and works fine also with translatable fields.

Having the language setting at the display level rather than next to the "Field translation" settings is debatable - is not really that obvious where fix is if you have an issue. But it's good enough for me so I'm marking this as a duplicate of #1674792: Rendered entity is not language aware