label field plus a JSON translations map keyed by locale code. At render time, the bundle selects the right label based on the current request locale and your locale configuration.
Options
The list of locales enabled for menu item labels (e.g.
['en', 'es', 'fr']). When this list is empty, the request locale is used as-is with no validation.The fallback locale used when the request locale is not present in
locales. When null, the first entry in locales is used as the fallback.config/packages/nowo_dashboard_menu.yaml
Locale resolution
When a menu is rendered, the bundle resolves the locale to use for item labels in this order:Check against enabled locales
If
locales is non-empty, the request locale is checked against the list. If it matches, it is used.When
locales is empty, the request locale is used as-is. No fallback is applied. This is useful during development when you want to match whatever locale Symfony currently reports.Menu item labels
Each menu item stores:label— the base label, used as the default when no translation is found for the resolved locale.translations— a JSON object mapping locale codes to translated labels, for example{"es": "Inicio", "fr": "Accueil"}.
Example: multi-language setup
config/packages/nowo_dashboard_menu.yaml
- A request with locale
fruses the French label if available, otherwise falls back tolabel. - A request with locale
pt(not in the list) usesenlabels. - A request with locale
enuses the English label if available, otherwiselabel.