Closed webdevilopers closed 8 years ago
Regarding KnpMenu Translation http://symfony.com/doc/current/bundles/KnpMenuBundle/i18n.html I tried this code:
protected function configureTabMenu(MenuItemInterface $menu, $action, AdminInterface $childAdmin = null) { if (!$childAdmin && !in_array($action, array('edit', 'show'))) { return; } $admin = $this->isChild() ? $this->getParent() : $this; $id = $admin->getRequest()->get('id'); $menu->addChild('List Products', array('uri' => $admin->generateUrl('sonata.admin.electrical_equipment.list', array('id' => $id)))) ->setExtra('translation_domain', 'InternalBundle'); $menu->addChild($this->trans('List Products'), array('uri' => $admin->generateUrl('sonata.admin.electrical_equipment.list', array('id' => $id)))); }
Unfortunately the first label is not being translated using setExtra. The translation file is fine since it works with $this->trans().
setExtra
$this->trans()
Is this an issue with a template outputting the tab menu or an KnpMenu issue?
Fixed by #3986 I think.
Regarding KnpMenu Translation http://symfony.com/doc/current/bundles/KnpMenuBundle/i18n.html I tried this code:
Unfortunately the first label is not being translated using
setExtra
. The translation file is fine since it works with$this->trans()
.Is this an issue with a template outputting the tab menu or an KnpMenu issue?