yokai-php / sonata-workflow

Integrate Symfony workflow component in Sonata Admin
MIT License
22 stars 11 forks source link

Transition item is not translated using the admin translation domain #7

Closed gremo closed 4 years ago

gremo commented 5 years ago

Here: https://github.com/yokai-php/sonata-workflow/blob/master/src/Admin/Extension/WorkflowExtension.php#L181 you are using:

$menu->addChild(
    $admin->getLabelTranslatorStrategy()->getLabel($transition->getName(), 'workflow'),
    $options
);

Which is correct, because the extension should use the same label translation strategy of the admin. But translation domain should be the same of the admin, this could be easily fixed:

$menu->setExtra('translation_domain', $admin->getTranslationDomain());
yann-eugone commented 5 years ago

Hello @gremo I hope you find this bundle useful. Thank you for reporting unexpected behaviors. I started a PR for the two issues you opened.

Please tell me if you find the changes suitable or not

gremo commented 5 years ago

@yann-eugone thanks so much, yes, I'm using this bundle for a new project and I've found very useful. I have another idea, but I'll open another issue maybe (enhancement).

yann-eugone commented 4 years ago

Fixed as of v0.2.0