Bring i18n code from spree

This commit is contained in:
Luis Ramos
2020-07-06 15:09:08 +01:00
parent 388d575cc8
commit 84d7538b1b
2 changed files with 18 additions and 0 deletions

17
lib/spree/i18n/base.rb Normal file
View File

@@ -0,0 +1,17 @@
module Spree
module ViewContext
def self.context=(context)
@context = context
end
def self.context
@context
end
def view_context
super.tap do |context|
Spree::ViewContext.context = context
end
end
end
end

View File

@@ -0,0 +1 @@
Spree::BaseController.send(:include, Spree::ViewContext)