Problem/Motivation
On a multi language site the list of autocompleted nodes always show up in the default language. Editing a Chinese site with admin UI language set to German, the list of nodes should be (as discussed with Gábor) returned in the UI language.
Proposed resolution
The autocomplete callback needs to consider the language settings.
Steps to reproduce
- install drupal 8
- enabling content translation module
- adding language
- enable translation for articles (admin/config/regional/content-language)
- add an entity reference field to the article content type
- create an article
- translate article
- create a second article, with the langcode in the url (for example: af/node/add/article)
- type something in the autocomplete entity reference field
- save the second article
- translate the second article
- check whether the entity reference field of the second article has correct title in all the languages
- check the above on each of the corresponding edit pages too
Remaining tasks
Review
Get to work without the if module exists content translation (See #83)
Eventually the languageManager needs to be pulled in through dependency injection.
User interface changes
Language of node titles in entity reference field match admin UI language instead of default site language.
API changes
None