Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
antoineayoub opened this issue May 11, 2016 · 3 comments
Open

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

antoineayoub opened this issue May 11, 2016 · 3 comments
Labels

Comments

@antoineayoub
Copy link

antoineayoub commented May 11, 2016

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

@chris-barklem
Copy link

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
Copy link

milep commented Aug 15, 2016

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)?

@raulpopadineti
Copy link

@milep your suggestion breaks the spree_social extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants