I am creating list in cakephp from DB like
$productTable = TableRegistry::get('Products');
$containerTypes = $productTable->find('list', [
'keyField' => 'type',
'valueField' => 'type'
])
->group(['type']);
I have added in the Model of Products table
$this->addBehavior('Translate', ['fields' => ['type']]);
Like it is described in CakePhp Book https://book.cakephp.org/3.0/en/orm/behaviors/translate.html#attaching-the-translate-behavior-to-your-tables
Doesn anybody know how can I translate list and why this method doesnt work? Thank you