Skip to content

v2.5.0

Latest

Choose a tag to compare

@damienlagae damienlagae released this 31 Jul 13:35

New features

  • Enabel:Ux:LocaleSwitcher gains labelFormat and header (#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.

    • labelFormatname (default, unchanged), code (EN) or none (flag only).
    • header — optional dropdown-header at the top of the menu, e.g. 'Change language'. Translate at the call site; defaults to null.
    {{ 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.5rem square, but the cif:* set has no single aspect ratio (cif:nl is 2:1, cif:gb is 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) with preserveAspectRatio="xMidYMid slice", and carry the locale's own-language name as title.

    Note both width and height are set explicitly: a host application's ux_icons.default_icon_attributes (commonly width/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