This project is not covered by Drupal’s security advisory policy.

This module brings better i18n support to Entity Reference field selection widget.

When using entity translation, the Entity Reference simple autocomplete selection will not filter the search results on the referencing entity language or the interface language. This module bridges this gap.

How does it work?

  1. Enable the module
  2. When creating/editig an Entity Reference field, configure the field instance widget to use the "Translation aware selection" (see: entity selection fieldset)
  3. You'll get an additional dropdown called "Language handling" with 2 options. Either filter the search results based on parent language or interface language
  4. Save the field

Now, when trying to reference content on that particular field instance, the autocomplete suggestions should be limited to those entities with matching language property.

Currently only supports node and taxonomy term entities.

Screencast

There's a screencast available on YouTube: https://www.youtube.com/watch?v=HrnWHSr0gSA

Inspiration

This module is based off code in #1462766: Add option to only list referenced entities in current language. Instead of patching Entity Reference itself, I leveraged its' implementation of the CTools Plugin API and implemented i18n support in a separate module.

Sponsored by XIO

Project information

Releases