getReferencableEntities() uses taxonomy_get_tree() to load taxonomy terms for the options lists (select widget) and the autocomplete widget.
taxonomy_get_tree() by default doesn't do an entity_load(), which means that the Title module can't do its magic, so the term name stays untranslated.

A simple one line patch fixes this issue, and allows terms to be returned in the correct language (on node add / edit forms, commerce add to cart form, etc).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bojanz’s picture

Status: Active » Needs review
FileSize
861 bytes
amitaibu’s picture

Status: Needs review » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

plach’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs review
FileSize
924 bytes

Same problem when using i18n_taxonomy to translate terms. We are missing an entity_label() call.

letrotteur’s picture

Works like a charm for me. Thanks

plach’s picture

Status: Needs review » Reviewed & tested by the community
GiorgosK’s picture

Status: Reviewed & tested by the community » Needs review

taxonomy with Localize or translate setting
added a few terms and translated them
entityreference on basic page
created a basic page
on English edit form terms appear
on Greek language edit from NO terms appear
but apparently on the view the terms are display correctly (translated)

have a look at a related issue #2028225: Term reference field on node edit fails to show translated taxonomy terms when Taxonomy term selected as a Translatable Entity

GiorgosK’s picture

This module helps resolve this problem
https://www.drupal.org/project/translated_entityreference
but not with select list (only autocomplete widget)

EDIT:
to use above mentioned module properly
I think you need to disable
"Select taxonomy terms by language"
in admin/config/regional/i18n/select

Stevel’s picture

Status: Needs review » Reviewed & tested by the community

Setting this back to RTBC

geek-merlin’s picture

#8:
> This module helps resolve this problem
> https://www.drupal.org/project/translated_entityreference

I don't think so.
That module is about entity translation.
This patch about string translation.

geek-merlin’s picture

YES i can confirm #4 patch fixes this issue for me. :-)

amitaibu’s picture

Status: Reviewed & tested by the community » Fixed

Merged, thanks.

  • amitaibu committed 561efab on 7.x-1.x authored by plach
    Issue #2013849 by plach, bojanz: Term names are not translated
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Status: Closed (fixed) » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: entityreference-translate_terms-2013849-4.patch, failed testing.

Stevel’s picture

Status: Needs work » Closed (fixed)

Back to Closed (fixed)