Files
openfoodnetwork/app/views/shared/menu/_language_selector.html.haml
Jean-Baptiste Bellet aa982fe8df Create a new method to change the lang of the app
- The old method (link to `?locale=#{l.to_s}`) was not functional for path that already has query params in current path (such as `/user/spree_user/password/edit?reset_password_token=`) ;
 - This seems that the best way to handle this, is to create a new route, new method that effectively set the lang (not the locale actually...) and then redirect_back (ie. using the HTTP_REFERER, with a fallback to `/`)

s
2021-07-06 10:09:37 +02:00

9 lines
310 B
Plaintext

%li.language-switcher.has-dropdown
%a{href: '#', class: "top-bar--menu-item-with-icon"}
%i.ofn-i_071-globe
%span= t 'language_name'
%ul.dropdown
- OpenFoodNetwork::I18nConfig.selectable_locales.each do |l|
%li
= link_to t('language_name', locale: l), main_app.locale_path(l.to_s)