i18n: display selected locale as active wit bold text

This commit is contained in:
Pierre de La Morinerie 2021-08-24 09:54:57 -05:00
parent 227b1dc462
commit 02a19587b7
2 changed files with 6 additions and 2 deletions

View file

@ -234,6 +234,10 @@ $header-mobile-breakpoint: 550px;
display: flex;
color: $black;
&.active {
font-weight: bold;
}
&:hover {
background: $light-grey;
}

View file

@ -4,8 +4,8 @@
= image_tag "icons/translate-icon.svg", alt: t('.languages'), width: 24, height: 24, lazy: true, aria: { hidden: true }
%ul.header-menu.dropdown-content
%li
= link_to save_locale_path(locale: :en), method: :post, class: "menu-item menu-link" do
= active_link_to save_locale_path(locale: :en), method: :post, class: "menu-item menu-link", active: I18n.locale == :en do
English
%li
= link_to save_locale_path(locale: :fr), method: :post, class: "menu-item menu-link" do
= active_link_to save_locale_path(locale: :fr), method: :post, class: "menu-item menu-link", active: I18n.locale == :fr do
Français