Skip to content

Commit bb291bd

Browse files
authored
Merge pull request #224 from bitberry-dev/master
Fix locale inconsistence and remove redundant template
2 parents a918b8b + 2a6ca76 commit bb291bd

3 files changed

Lines changed: 20 additions & 13 deletions

File tree

lib/controllers/backend/spree/admin/user_passwords_controller.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,15 @@ def update
4242
super
4343
end
4444
end
45+
46+
private
47+
48+
# NOTE: as soon as this gem stops supporting Solidus 3.1 if-else should be removed and left only include
49+
if defined?(::Spree::Admin::SetsUserLanguageLocaleKey)
50+
include ::Spree::Admin::SetsUserLanguageLocaleKey
51+
else
52+
def set_user_language_locale_key
53+
:admin_locale
54+
end
55+
end
4556
end

lib/controllers/backend/spree/admin/user_sessions_controller.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ def authorization_failure
3535

3636
private
3737

38+
# NOTE: as soon as this gem stops supporting Solidus 3.1 if-else should be removed and left only include
39+
if defined?(::Spree::Admin::SetsUserLanguageLocaleKey)
40+
include ::Spree::Admin::SetsUserLanguageLocaleKey
41+
else
42+
def set_user_language_locale_key
43+
:admin_locale
44+
end
45+
end
46+
3847
def accurate_title
3948
I18n.t('spree.login')
4049
end

lib/views/backend/spree/layouts/admin/_login_nav.html.erb

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)