How to limit Entity Reference to only allow referencing of nodes with the same (or undefined) language?-Collection of common programming errors

I’m looking for the same thing.

The closest I got was by using the current user’s language. The current user’s language will be determined by what you select in /admin/config/regional/language/configure.

  • add relationship “Entity translation: translations”
  • add filter “Entity translation: Language (=Current user’s language)”

Also, this link cleared the field_title issue for me: https://drupal.org/node/1327012.

So, for example, going to /en/node/add will populate the entity view with the referenced entities in English. But, if the user changes the language on the edit form the view will remain the same.

This solution would suffice if the referenced entities were the same in all languages and simply translated (like the “localize terms” functionality that that core taxonomy translation provides).

The only other ‘quick and dirty’ way I can think of is editing the output of the title field in views and adding a css class according to the language. Then writing some jquery that shows/hides the entities by mapping the class of the entity in the view to the language selection field.

*Ideally, the entity view should repopulate via ajax according to the language selected in the node edit from.*

If anybody has any ideas please let us know.

Thanks