We offer a handy EntityTranslatorTrait so you can translate entities anywhere.
You can pass a parameter (bool $strict = TRUE) to make sure the trait only returns entities that are in the target language.
If they aren't translated, the Trait doesn't return it back and either returns NULL or an empty array, depending on which method you used.
When the checked entity doesn't implement the TranslatableInterface, we ignore the $strict check.
However, we should also skip when ->isTranslatable() returns FALSE.
Right now, the entity is being discarded.
Issue fork entity_model-3366727
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
dieterholvoet commentedLooks good!
Comment #5
dieterholvoet commented