Edit: You committed something about that in menu.html.twig @kevinpapst
added method to configure translation domain for menu items (#150)
But still the case for the navbar
|
<a href="#" class="dropdown-item">{{ link.label|trans }}</a> |
I'm currently experiencing some translation errors when using the menu and navbar.
What I got
From a subscriber, I implement some items to the menu.
These items have labels that are already translated inside the subscriber.
$changePassword = new MenuItemModel(
'change_password',
$this->translator->trans('action.edit_profile'), // <----- HERE
'user_edit',
['user_uuid' => $user->getUuid()]
);
$event->addLink($changePassword);
What TablerBundle does
When TablerBundle print the twig result of the menu item, it tries to trans a content that is already translated.
Like {{ 'Modifier mon profil'|trans }}.
What is the problem?
Because of this, Symfony tells me that I have missing/wrong translations.

What is the solution?
- Add the
trans domain to any trans function/filter that the bundle uses
❌ I don't think this is a good idea:
- Translations like that are not auto discovered by
bin/console translation:extract (huge nono for me)
- I found it easier to expect as a dev, to do a "raw" print by the bundle if my label is a message ID.
- DO NOT try to translate content that devs define.
Only word/phrase that we define in the bundle.
✔️ Rude, but I'll take it!
I'm currently experiencing some translation errors when using the menu and navbar.
What I got
From a subscriber, I implement some items to the menu.
These items have labels that are already translated inside the subscriber.
What TablerBundle does
When TablerBundle print the twig result of the menu item, it tries to trans a content that is already translated.
Like
{{ 'Modifier mon profil'|trans }}.What is the problem?
Because of this, Symfony tells me that I have missing/wrong translations.
What is the solution?
trans domainto any trans function/filter that the bundle uses❌ I don't think this is a good idea:
bin/console translation:extract(huge nono for me)Only word/phrase that we define in the bundle.
✔️ Rude, but I'll take it!