While indexing the content in multilanguage environment elasticsearch_helper_content submodule uses setConfigOverrideLanguage method of languageManager service. But apparently this is not enough. As it is using the rendered view of the entity that may use custom twig templates with translation filters it is necessary to change the language in more sophisticated way.
The attached patch is inspired by commerce module mail hander. I copied completely one method from it that is used to switching the language, when handling translatable twig templates.
Please review the patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | change_active_language-3086338-3.patch | 5.75 KB | j-lee |
| change_active_language.patch | 5.73 KB | a.dmitriiev |
Comments
Comment #2
j-leeAfter a quick view, the patch looks good to me.
Comment #3
j-leeReroll against latest dev