feat(i18n): enable localization by query param

Providing a query param ("locale") will enable localization. A language picker will be shown once
localization is activated. Locale is stored in a cookie "locale".
This commit is contained in:
Paul Chavard 2021-08-24 11:39:15 +02:00
parent 3b93336c20
commit 3b6528decf
7 changed files with 44 additions and 20 deletions

View file

@ -5,6 +5,7 @@ describe 'layouts/_header.html.haml', type: :view do
allow(view).to receive(:multiple_devise_profile_connect?).and_return(false)
allow(view).to receive(:instructeur_signed_in?).and_return((profile == :instructeur))
allow(view).to receive(:current_instructeur).and_return(current_instructeur)
allow(view).to receive(:localization_enabled?).and_return(false)
if user
sign_in user

View file

@ -5,6 +5,7 @@ describe 'layouts/procedure_context.html.haml', type: :view do
before do
allow(view).to receive(:instructeur_signed_in?).and_return(false)
allow(view).to receive(:administrateur_signed_in?).and_return(false)
allow(view).to receive(:localization_enabled?).and_return(false)
end
subject do