spree-contrib/spree_i18n

Locale doesn't set on spree login / sign-up

antoineayoub opened this issue · 3 comments

Hello,
I'm new rails and spree. I have an issue with my locale just on the Login and Signup pages. I surf with a certain language in my website but when i go to the login or sign-up page it is changing to :en (default language). I tried to find where the locale is set in Spree_Auth but i could not find where it is.

Why it doesn't set the good local ?

Gemfile

gem 'spree', github: 'spree/spree', branch: '3-1-stable'
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: '3-1-stable'
gem 'spree_gateway', github: 'spree/spree_gateway', branch: '3-1-stable'
gem 'spree_i18n', github: 'spree-contrib/spree_i18n', branch: '3-1-stable'
gem 'spree_globalize', github: 'spree-contrib/spree_globalize', branch: 'master'

Thanks for your help

I have the same problem.

gem 'spree', '~> 3.1.0.rc1'
gem 'spree_auth_devise', '~> 3.1.0.rc1'
gem 'spree_gateway', '~> 3.1.0.rc1'
gem 'spree_i18n', git: 'git://github.com/spree/spree_i18n.git', branch: '3-1-stable'
gem 'spree_reviews', github: 'spree-contrib/spree_reviews', branch: '3-1-stable'
gem 'spree_globalize', github: 'spree-contrib/spree_globalize', branch: 'master'
gem 'spree_static_content', github: 'spree-contrib/spree_static_content', branch: '3-1-stable'

Login and signup always returns the default locale.

milep commented

You need to add decorator for auth_devise controllers. eg.

Spree::UserSessionsController.class_eval do
  include SpreeI18n::ControllerLocaleHelper
end

Maybe this could be done automagically by this gem(if spree_auth_devise is in use)?

@milep your suggestion breaks the spree_social extension.