New features
-
✨
Enabel:Ux:LocaleSwitchergainslabelFormatandheader(#29)Apps carrying three or more locales could not afford the full own-language name in the navbar — English / Français / Nederlands eats the space the menu items need — while the only alternative,
showLocaleName: false, left a bare flag with no textual cue.labelFormat—name(default, unchanged),code(EN) ornone(flag only).header— optionaldropdown-headerat the top of the menu, e.g.'Change language'. Translate at the call site; defaults tonull.
{{ component('Enabel:Ux:LocaleSwitcher', { locales: enabled_locales, labelFormat: 'code', header: 'navigation.language.change'|trans, }) }}
Bug fixes
-
Flags are no longer letterboxed inside their own border. They were forced into a
1.5remsquare, but thecif:*set has no single aspect ratio (cif:nlis 2:1,cif:gbis 3:2), so the flag shrank and centred while the rounding and border framed empty space. Flags now render in a fixed 4:3 box (1.5rem × 1.125rem) withpreserveAspectRatio="xMidYMid slice", and carry the locale's own-language name astitle.Note both width and height are set explicitly: a host application's
ux_icons.default_icon_attributes(commonlywidth/height: 1em) otherwise wins and forces the square back.
Backward compatibility
showLocaleName keeps working — labelFormat is derived from it, so a call site passing false still resolves to none, and an explicit labelFormat always wins. The property is now marked @deprecated; prefer labelFormat.
The only visual change for callers passing nothing is the corrected flag styling. The label still defaults to the own-language name.
Docs
The LocaleSwitcher docs documented the parameter as show_locale_name; the component has always read showLocaleName.
Full Changelog: v2.4.1...v2.5.0