mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
- 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
9 lines
310 B
Plaintext
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)
|