Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I don't see anything about translation.
My website uses i18n.
Content type B as an entityref field pointing to content type A.
Content type A and content type B are multilingual.
I first translate a content type A node. Then I translate content type B node.
I have node A1, with translation = node A1t
I create node B1, pointing to A1.
I translate node B1. The select list for entityref shows only nodes of current language, that's fine. But node A1t is not selected.
How can I do to get by default the A1t selected?
Is there a configuration I'm missing?
Comments
Comment #1
FiNeX CreditAttribution: FiNeX commentedUnfortunatly it looks like entity reference is not yet i18n aware. If you need node reference with i18n you should stay with D6.
Comment #2
colanFor D7, you may want to try field translation instead of node translation.
Comment #3
sahuni CreditAttribution: sahuni commentedI had a look (and a try) to entity translation, but I think we (the module and me) are not ready for that.
I'll try that on a new website in D7, but not when migrating a complex website from D6 to D7. Now internationalization works well in D6 and I don't want to play with it.
I think I can do it with references module and I'll continue my test in that way. If no success, I'll leave that upgrade for some months until things are more clear.
Comment #5
FiNeX CreditAttribution: FiNeX commented@colan: using entity translation is not an option now: it is still under heavy development and many modules still doesn't support it.
Comment #6
benjifisherThis works for my site. Maybe a similar approach will work for yours. Set up a chain of Relationships (using the "Advanced" settings in Views)
B1t -> B1 -> A1 -> A1t
The options you can use the set up the references are
Content translation: Source translation
Entity Reference: Referenced Entity
Content translation: Translations
(in that order). The last one has the default option "Current language," which works for me; if you need the view to select the same language as B1t, then you may need to do something different.
I am still working on this. I think (but have not tested yet) that when you translate a node, the entity references are copied over. If so, then you should be able to link B1t directly to A1.
Comment #7
devad CreditAttribution: devad commented@sahuni
You need contrib module Internationalization contributions. "Synchronize Entity reference" sub-module (i18n_entityreference) has support for this.
Comment #8
sahuni CreditAttribution: sahuni commentedThanks, I'll try that during winter and report