I have the Translate behaviour on a ArticlesTable in a CakePHP 3.6 application. Based on the documentation you can find specific translations on an Entity using the following:
$results = $this->Articles->find('translations', [
'locales' => ['en', 'es']
]);
$article = $results->first();
$spanishTranslation = $article->translation('es');
$englishTranslation = $article->translation('en');
The above code returns ALL the english and spanish translations for ALL the rows in articles table.
What if I want to find only the english translation of the entity with id 5 for example?
I tried adding foreign_key => 5 in the find query like the following but it didn't work:
$results = $this->Categories->find('translations', [
'locales' => ['en_US'], 'foreign_key' => 5
]);
Thanks in advanced for any help.